Kotlin 1.7.20 comes with a new Kotlin rangeUntil operator (preview):
..<
~ 1 minutes read
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:
No need to set the language-version to
1.8
inbuild.gradle.kts
with Kotlin 1.9:What’s new in 1.9 -> stable operator for open ended ranges.