CharSequence

Properties

Link copied to clipboard
abstract val length: Int

Functions

Link copied to clipboard

Returns whether this string contains char.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract operator fun get(index: Int): Char
Link copied to clipboard
fun CharSequence.indexOf(char: Char, startIndex: Int = 0): Int

Finds the first matching character at or after startIndex, clamped to zero.

fun CharSequence.indexOf(other: String, startIndex: Int = 0): Int
Link copied to clipboard

Returns whether this character sequence is empty or contains only whitespace.

Link copied to clipboard

Returns whether this character sequence contains no characters.

Link copied to clipboard

Returns whether this character sequence contains a non-whitespace character.

Link copied to clipboard

Returns whether this character sequence contains at least one character.

Link copied to clipboard

Visits UTF-16 code units in order. Stored iterators are supported and own their position.

Link copied to clipboard

Finds the last matching character.

Finds the last matching substring, starting at the last character.

fun CharSequence.lastIndexOf(char: Char, startIndex: Int): Int

Searches backwards from startIndex for char.

fun CharSequence.lastIndexOf(string: String, startIndex: Int): Int

Searches backwards from startIndex for string, comparing UTF-16 code units.

Link copied to clipboard

Splits on CRLF, LF or CR, retaining empty lines including the final line.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Removes suffix when present, otherwise returns this string.

Link copied to clipboard
Link copied to clipboard
fun CharSequence.split(delimiter: Char, limit: Int = 0): List<String>

Splits on delimiter, retaining empty parts. Zero limit means no limit; positive limit keeps the remaining suffix.

fun CharSequence.split(delimiter: String, limit: Int = 0): List<String>

Splits on delimiter, retaining empty parts. An empty delimiter separates UTF-16 code units, including empty ends.

Link copied to clipboard
Link copied to clipboard
abstract fun subSequence(startIndex: Int, endIndex: Int): CharSequence
Link copied to clipboard
fun CharSequence.substring(startIndex: Int): String

fun CharSequence.substring(startIndex: Int, endIndex: Int): String

Materializes the selected UTF-16 range as an immutable String.

Link copied to clipboard

Counts and indexes refer to UTF-16 code units, including individual surrogate halves.

Link copied to clipboard
Link copied to clipboard

Removes leading and trailing whitespace.

Link copied to clipboard

Removes trailing whitespace.

Link copied to clipboard

Removes leading whitespace.