Constructors

Link copied to clipboard
constructor()
constructor(chars: CharArray)
constructor(chars: CharArray, offset: Int, length: Int)

Properties

Link copied to clipboard
open external override val length: Int

Functions

Link copied to clipboard
open operator external override fun compareTo(other: String): Int
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
open operator external override 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
fun String.padEnd(length: Int): String
fun CharSequence.padEnd(length: Int, padChar: Char): CharSequence
fun String.padEnd(length: Int, padChar: Char): String
Link copied to clipboard
fun String.padStart(length: Int): String
fun CharSequence.padStart(length: Int, padChar: Char): CharSequence
fun String.padStart(length: Int, padChar: Char): String
Link copied to clipboard
operator external fun plus(other: Any?): String
Link copied to clipboard

Removes prefix when present, otherwise returns this string.

Link copied to clipboard

Removes suffix when present, otherwise returns this string.

Link copied to clipboard
Link copied to clipboard
fun String.replace(oldChar: Char, newChar: Char): String

Replaces every oldChar with newChar, comparing case-sensitively.

fun String.replace(oldValue: String, newValue: String): String

Replaces nonoverlapping oldValue matches. An empty oldValue inserts newValue at every UTF-16 boundary.

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
open external override fun subSequence(startIndex: Int, endIndex: Int): String
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
fun String.substringAfter(delimiter: Char): String

Returns the part after the first delimiter, or this string if absent.

fun String.substringAfter(delimiter: Char, missingDelimiterValue: String): String
fun String.substringAfter(delimiter: String, missingDelimiterValue: String): String

Returns the part after the first delimiter, or missingDelimiterValue if absent.

Link copied to clipboard

Returns the part after the last delimiter, or this string if absent.

fun String.substringAfterLast(delimiter: Char, missingDelimiterValue: String): String
fun String.substringAfterLast(delimiter: String, missingDelimiterValue: String): String

Returns the part after the last delimiter, or missingDelimiterValue if absent.

Link copied to clipboard

Returns the part before the first delimiter, or this string if absent.

fun String.substringBefore(delimiter: Char, missingDelimiterValue: String): String
fun String.substringBefore(delimiter: String, missingDelimiterValue: String): String

Returns the part before the first delimiter, or missingDelimiterValue if absent.

Link copied to clipboard

Returns the part before the last delimiter, or this string if absent.

fun String.substringBeforeLast(delimiter: Char, missingDelimiterValue: String): String
fun String.substringBeforeLast(delimiter: String, missingDelimiterValue: String): String

Returns the part before the last delimiter, or missingDelimiterValue if absent.

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
fun String.toByte(radix: Int): Byte
Link copied to clipboard
Link copied to clipboard
fun String.toInt(radix: Int): Int
Link copied to clipboard
Link copied to clipboard
fun String.toLong(radix: Int): Long
Link copied to clipboard
Link copied to clipboard

Converts an absolute path string to a lexical value without accessing storage.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun String.toUInt(radix: Int): UInt
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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.