TextRange

Function
Common
fun TextRange(/*@IntRange(from = 0)*/ start: Int, /*@IntRange(from = 0)*/ end: Int) =
    TextRange(packWithCheck(start, end))

An immutable text range class, represents a text range from start (inclusive) to end (exclusive). end can be smaller than start and in those cases min and max can be used in order to fetch the values.

Parameters

start the inclusive start offset of the range. Must be non-negative, otherwise an exception will be thrown.
end the exclusive end offset of the range. Must be non-negative, otherwise an exception will be thrown.
Common
fun TextRange(index: Int): TextRange

Creates a TextRange where start is equal to end, and the value of those are index.