rangeTo

inline operator fun rangeTo(other: CodePoint): CodePointRange(source)

Creates a range from this value to the specified other value.

The range is inclusive of the start value and inclusive of the end value.

Since Kotlin

2.5

Samples

import kotlin.text.unicode.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   val rangeInclusive = 'A'.toCodePoint()..'Z'.toCodePoint()
println("'Z'.toCodePoint() in rangeInclusive is ${'Z'.toCodePoint() in rangeInclusive}") // true
println(rangeInclusive.take(5).joinToString()) // A, B, C, D, E

val rangeExclusive = CodePoint(0x1F601)..<CodePoint(0x1F60B)
println(rangeExclusive.joinToString()) // 😁, πŸ˜‚, πŸ˜ƒ, πŸ˜„, πŸ˜…, πŸ˜†, πŸ˜‡, 😈, πŸ˜‰, 😊 
   //sampleEnd
}