Setup — New Kotlin Range Operator: rangeUntil

Lothar Schulz
lotharschulz
Published in
Oct 23, 2022

--

Kotlin 1.7.20 comes with a new Kotlin rangeUntil operator (preview):

..<

In order to use the new operator, you need to enable the -language-version 1.8 flag.

You can set the language-version 1.8 in build.gradle.kts:

An experimental annotation must be added, e.g.: @OptIn(ExperimentalStdlibApi::class) and the new rangeUntil operator has the same functionality that the until operator:

Source Code

Originally published at https://www.lotharschulz.info.

--

--