TextRange
@Immutable inline class TextRange
kotlin.Any | |
↳ | androidx.compose.ui.text.TextRange |
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.
Summary
Public methods | |
---|---|
operator Boolean |
Returns true if this range covers including equals with the given range. |
operator Boolean |
Returns true if the given offset is a part of this range. |
Boolean |
intersects(other: TextRange) Returns true if the given range has intersection with this range |
String |
toString() |
Properties | |
---|---|
Boolean |
Returns true if the range is collapsed |
Int | |
Int |
Returns the length of the range. |
Int |
The maximum offset of the range. |
Int |
The minimum offset of the range. |
Boolean |
Returns true if the start offset is larger than the end offset. |
Int |
Companion properties | |
---|---|
TextRange |
Public methods
contains
operator fun contains(other: TextRange): Boolean
Returns true if this range covers including equals with the given range.
contains
operator fun contains(offset: Int): Boolean
Returns true if the given offset is a part of this range.
intersects
fun intersects(other: TextRange): Boolean
Returns true if the given range has intersection with this range
toString
fun toString(): String
Properties
end
val end: Int
start
val start: Int
Companion properties
Zero
val Zero: TextRange