String

The String class represents character strings. All string literals in Kotlin programs, such as "abc", are implemented as instances of this class.

The String class represents character strings. All string literals in Kotlin programs, such as "abc", are implemented as instances of this class.

Constructors

Link copied to clipboard
fun String()
fun String()
fun String()

Types

Link copied to clipboard
object Companion
object Companion
object Companion

Functions

Link copied to clipboard
open operator override fun compareTo(other: String): Int
open operator override fun compareTo(other: String): Int

Compares this object with the specified object for order. Returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.

open operator external override fun compareTo(other: String): Int

Compares this object with the specified object for order. Returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.

Link copied to clipboard
open operator external override fun equals(other: Any?): Boolean
Link copied to clipboard
open operator override fun get(index: Int): Char

Returns the character of this string at the specified index.

open operator override fun get(index: Int): Char

Returns the character of this string at the specified index.

open operator external override fun get(index: Int): Char

Returns the character of this string at the specified index.

Link copied to clipboard
open external override fun hashCode(): Int
Link copied to clipboard
operator fun plus(other: Any?): String

Returns a string obtained by concatenating this string with the string representation of the given other object.

operator fun plus(other: Any?): String

Returns a string obtained by concatenating this string with the string representation of the given other object.

operator fun plus(other: Any?): String
Link copied to clipboard
open override fun subSequence(startIndex: Int, endIndex: Int): CharSequence
open override fun subSequence(startIndex: Int, endIndex: Int): CharSequence

Returns a new character sequence that is a subsequence of this character sequence, starting at the specified startIndex and ending right before the specified endIndex.

open external override fun subSequence(startIndex: Int, endIndex: Int): CharSequence

Returns a new character sequence that is a subsequence of this character sequence, starting at the specified startIndex and ending right before the specified endIndex.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
open override val length: Int
open override val length: Int

Returns the length of this character sequence.

open override val length: Int

Returns the length of this character sequence.

Extensions

Link copied to clipboard
inline fun CharSequence.all(predicate: (Char) -> Boolean): Boolean
inline fun CharSequence.all(predicate: (Char) -> Boolean): Boolean
inline fun CharSequence.all(predicate: (Char) -> Boolean): Boolean

Returns true if all characters match the given predicate.

Link copied to clipboard

Returns true if char sequence has at least one character.

inline fun CharSequence.any(predicate: (Char) -> Boolean): Boolean
inline fun CharSequence.any(predicate: (Char) -> Boolean): Boolean
inline fun CharSequence.any(predicate: (Char) -> Boolean): Boolean

Returns true if at least one character matches the given predicate.

Link copied to clipboard

Creates an Iterable instance that wraps the original char sequence returning its characters when being iterated.

Link copied to clipboard

Creates a Sequence instance that wraps the original char sequence returning its characters when being iterated.

Link copied to clipboard
inline fun <K, V> CharSequence.associate(transform: (Char) -> Pair<K, V>): Map<K, V>
inline fun <K, V> CharSequence.associate(transform: (Char) -> Pair<K, V>): Map<K, V>
inline fun <K, V> CharSequence.associate(transform: (Char) -> Pair<K, V>): Map<K, V>

Returns a Map containing key-value pairs provided by transform function applied to characters of the given char sequence.

Link copied to clipboard
inline fun <K> CharSequence.associateBy(keySelector: (Char) -> K): Map<K, Char>
inline fun <K> CharSequence.associateBy(keySelector: (Char) -> K): Map<K, Char>
inline fun <K> CharSequence.associateBy(keySelector: (Char) -> K): Map<K, Char>

Returns a Map containing the characters from the given char sequence indexed by the key returned from keySelector function applied to each character.

inline fun <K, V> CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V>
inline fun <K, V> CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V>
inline fun <K, V> CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V>

Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to characters of the given char sequence.

Link copied to clipboard
inline fun <K, M : MutableMap<in K, in Char>> CharSequence.associateByTo(destination: M, keySelector: (Char) -> K): M
inline fun <K, M : MutableMap<in K, in Char>> CharSequence.associateByTo(destination: M, keySelector: (Char) -> K): M
inline fun <K, M : MutableMap<in K, in Char>> CharSequence.associateByTo(destination: M, keySelector: (Char) -> K): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each character of the given char sequence and value is the character itself.

inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateByTo(    destination: M,     keySelector: (Char) -> K,     valueTransform: (Char) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateByTo(    destination: M,     keySelector: (Char) -> K,     valueTransform: (Char) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateByTo(    destination: M,     keySelector: (Char) -> K,     valueTransform: (Char) -> V): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function and and value is provided by the valueTransform function applied to characters of the given char sequence.

Link copied to clipboard
inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateTo(destination: M, transform: (Char) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateTo(destination: M, transform: (Char) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> CharSequence.associateTo(destination: M, transform: (Char) -> Pair<K, V>): M

Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each character of the given char sequence.

Link copied to clipboard
inline fun <V> CharSequence.associateWith(valueSelector: (Char) -> V): Map<Char, V>
inline fun <V> CharSequence.associateWith(valueSelector: (Char) -> V): Map<Char, V>
inline fun <V> CharSequence.associateWith(valueSelector: (Char) -> V): Map<Char, V>

Returns a Map where keys are characters from the given char sequence and values are produced by the valueSelector function applied to each character.

Link copied to clipboard
inline fun <V, M : MutableMap<in Char, in V>> CharSequence.associateWithTo(destination: M, valueSelector: (Char) -> V): M
inline fun <V, M : MutableMap<in Char, in V>> CharSequence.associateWithTo(destination: M, valueSelector: (Char) -> V): M
inline fun <V, M : MutableMap<in Char, in V>> CharSequence.associateWithTo(destination: M, valueSelector: (Char) -> V): M

Populates and returns the destination mutable map with key-value pairs for each character of the given char sequence, where key is the character itself and value is provided by the valueSelector function applied to that key.

Link copied to clipboard
inline fun String.byteInputStream(charset: Charset = Charsets.UTF_8): ByteArrayInputStream
inline fun String.byteInputStream(charset: Charset = Charsets.UTF_8): ByteArrayInputStream
inline fun String.byteInputStream(charset: Charset = Charsets.UTF_8): ByteArrayInputStream

Creates a new byte input stream for the string.

Link copied to clipboard
expect fun String.capitalize(): String
expect fun String.capitalize(): String
expect fun String.capitalize(): String

Returns a copy of this string having its first letter titlecased using the rules of the default locale, or the original string if it's empty or already starts with a title case letter.

Returns a copy of this string having its first letter titlecased using the rules of the specified locale, or the original string if it's empty or already starts with a title case letter.

actual fun String.capitalize(): String
actual fun String.capitalize(): String
actual fun String.capitalize(): String

Returns a copy of this string having its first letter titlecased using the rules of the default locale, or the original string if it's empty or already starts with a title case letter.

actual fun String.capitalize(): String
actual fun String.capitalize(): String
actual fun String.capitalize(): String

Returns a copy of this string having its first letter titlecased using the rules of the default locale, or the original string if it's empty or already starts with a title case letter.

actual fun String.capitalize(): String
actual fun String.capitalize(): String
actual fun String.capitalize(): String

Returns a copy of this string having its first letter titlecased using the rules of the default locale, or the original string if it's empty or already starts with a title case letter.

Link copied to clipboard

Splits this char sequence into a list of strings each not exceeding the given size.

fun <R> CharSequence.chunked(size: Int, transform: (CharSequence) -> R): List<R>
fun <R> CharSequence.chunked(size: Int, transform: (CharSequence) -> R): List<R>
fun <R> CharSequence.chunked(size: Int, transform: (CharSequence) -> R): List<R>

Splits this char sequence into several char sequences each not exceeding the given size and applies the given transform function to an each.

Link copied to clipboard

Splits this char sequence into a sequence of strings each not exceeding the given size.

fun <R> CharSequence.chunkedSequence(size: Int, transform: (CharSequence) -> R): Sequence<R>
fun <R> CharSequence.chunkedSequence(size: Int, transform: (CharSequence) -> R): Sequence<R>
fun <R> CharSequence.chunkedSequence(size: Int, transform: (CharSequence) -> R): Sequence<R>

Splits this char sequence into several char sequences each not exceeding the given size and applies the given transform function to an each.

Link copied to clipboard
inline fun String.codePointAt(index: Int): Int
inline fun String.codePointAt(index: Int): Int
inline fun String.codePointAt(index: Int): Int

Returns the character (Unicode code point) at the specified index.

Link copied to clipboard
inline fun String.codePointBefore(index: Int): Int
inline fun String.codePointBefore(index: Int): Int
inline fun String.codePointBefore(index: Int): Int

Returns the character (Unicode code point) before the specified index.

Link copied to clipboard
inline fun String.codePointCount(beginIndex: Int, endIndex: Int): Int
inline fun String.codePointCount(beginIndex: Int, endIndex: Int): Int
inline fun String.codePointCount(beginIndex: Int, endIndex: Int): Int

Returns the number of Unicode code points in the specified text range of this String.

Link copied to clipboard
fun CharSequence.commonPrefixWith(other: CharSequence, ignoreCase: Boolean = false): String
fun CharSequence.commonPrefixWith(other: CharSequence, ignoreCase: Boolean = false): String
fun CharSequence.commonPrefixWith(other: CharSequence, ignoreCase: Boolean = false): String

Returns the longest string prefix such that this char sequence and other char sequence both start with this prefix, taking care not to split surrogate pairs. If this and other have no common prefix, returns the empty string.

Link copied to clipboard
fun CharSequence.commonSuffixWith(other: CharSequence, ignoreCase: Boolean = false): String
fun CharSequence.commonSuffixWith(other: CharSequence, ignoreCase: Boolean = false): String
fun CharSequence.commonSuffixWith(other: CharSequence, ignoreCase: Boolean = false): String

Returns the longest string suffix such that this char sequence and other char sequence both end with this suffix, taking care not to split surrogate pairs. If this and other have no common suffix, returns the empty string.

Link copied to clipboard
expect fun String.compareTo(other: String, ignoreCase: Boolean = false): Int
expect fun String.compareTo(other: String, ignoreCase: Boolean = false): Int
expect fun String.compareTo(other: String, ignoreCase: Boolean = false): Int

Compares two strings lexicographically, optionally ignoring case differences.

actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int
actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int
actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int

Compares two strings lexicographically, optionally ignoring case differences.

actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int
actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int
actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int
actual fun String.compareTo(other: String, ignoreCase: Boolean): Int
actual fun String.compareTo(other: String, ignoreCase: Boolean): Int
actual fun String.compareTo(other: String, ignoreCase: Boolean): Int
Link copied to clipboard
inline fun String.concat(str: String): String
inline fun String.concat(str: String): String
inline fun String.concat(str: String): String
Link copied to clipboard
operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boolean = false): Boolean
operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boolean = false): Boolean
operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boolean = false): Boolean

Returns true if this char sequence contains the specified other sequence of characters as a substring.

operator fun CharSequence.contains(char: Char, ignoreCase: Boolean = false): Boolean
operator fun CharSequence.contains(char: Char, ignoreCase: Boolean = false): Boolean
operator fun CharSequence.contains(char: Char, ignoreCase: Boolean = false): Boolean

Returns true if this char sequence contains the specified character char.

inline operator fun CharSequence.contains(regex: Regex): Boolean
inline operator fun CharSequence.contains(regex: Regex): Boolean
inline operator fun CharSequence.contains(regex: Regex): Boolean

Returns true if this char sequence contains at least one match of the specified regular expression regex.

Link copied to clipboard
expect infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean
expect infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean
expect infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

expect fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean
expect fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean
expect fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

inline fun String.contentEquals(charSequence: CharSequence): Boolean
inline fun String.contentEquals(charSequence: CharSequence): Boolean
inline fun String.contentEquals(charSequence: CharSequence): Boolean

Returns true if this string is equal to the contents of the specified CharSequence, false otherwise.

inline fun String.contentEquals(stringBuilder: StringBuffer): Boolean
inline fun String.contentEquals(stringBuilder: StringBuffer): Boolean
inline fun String.contentEquals(stringBuilder: StringBuffer): Boolean

Returns true if this string is equal to the contents of the specified StringBuffer, false otherwise.

actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean
actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean
actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean
actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean
actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean
actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean
actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean
actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean
actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean
actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean
actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean
actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean
actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

Link copied to clipboard
inline fun CharSequence.count(): Int
inline fun CharSequence.count(): Int
inline fun CharSequence.count(): Int

Returns the length of this char sequence.

inline fun CharSequence.count(predicate: (Char) -> Boolean): Int
inline fun CharSequence.count(predicate: (Char) -> Boolean): Int
inline fun CharSequence.count(predicate: (Char) -> Boolean): Int

Returns the number of characters matching the given predicate.

Link copied to clipboard
Link copied to clipboard
expect fun String.decapitalize(): String
expect fun String.decapitalize(): String
expect fun String.decapitalize(): String

Returns a copy of this string having its first letter lowercased using the rules of the default locale, or the original string if it's empty or already starts with a lower case letter.

Returns a copy of this string having its first letter lowercased using the rules of the specified locale, or the original string, if it's empty or already starts with a lower case letter.

actual fun String.decapitalize(): String
actual fun String.decapitalize(): String
actual fun String.decapitalize(): String

Returns a copy of this string having its first letter lowercased using the rules of the default locale, or the original string if it's empty or already starts with a lower case letter.

actual fun String.decapitalize(): String
actual fun String.decapitalize(): String
actual fun String.decapitalize(): String

Returns a copy of this string having its first letter lowercased using the rules of the default locale, or the original string if it's empty or already starts with a lower case letter.

actual fun String.decapitalize(): String
actual fun String.decapitalize(): String
actual fun String.decapitalize(): String

Returns a copy of this string having its first letter lowercased using the rules of the default locale, or the original string if it's empty or already starts with a lower case letter.

Link copied to clipboard

Returns a string with the first n characters removed.

Returns a subsequence of this char sequence with the first n characters removed.

Link copied to clipboard

Returns a string with the last n characters removed.

Returns a subsequence of this char sequence with the last n characters removed.

Link copied to clipboard
inline fun String.dropLastWhile(predicate: (Char) -> Boolean): String
inline fun String.dropLastWhile(predicate: (Char) -> Boolean): String
inline fun String.dropLastWhile(predicate: (Char) -> Boolean): String

Returns a string containing all characters except last characters that satisfy the given predicate.

inline fun CharSequence.dropLastWhile(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.dropLastWhile(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.dropLastWhile(predicate: (Char) -> Boolean): CharSequence

Returns a subsequence of this char sequence containing all characters except last characters that satisfy the given predicate.

Link copied to clipboard
inline fun String.dropWhile(predicate: (Char) -> Boolean): String
inline fun String.dropWhile(predicate: (Char) -> Boolean): String
inline fun String.dropWhile(predicate: (Char) -> Boolean): String

Returns a string containing all characters except first characters that satisfy the given predicate.

inline fun CharSequence.dropWhile(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.dropWhile(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.dropWhile(predicate: (Char) -> Boolean): CharSequence

Returns a subsequence of this char sequence containing all characters except first characters that satisfy the given predicate.

Link copied to clipboard
expect fun CharSequence.elementAt(index: Int): Char
expect fun CharSequence.elementAt(index: Int): Char
expect fun CharSequence.elementAt(index: Int): Char

Returns a character at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this char sequence.

actual inline fun CharSequence.elementAt(index: Int): Char
actual inline fun CharSequence.elementAt(index: Int): Char
actual inline fun CharSequence.elementAt(index: Int): Char

Returns a character at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this char sequence.

actual fun CharSequence.elementAt(index: Int): Char
actual fun CharSequence.elementAt(index: Int): Char
actual fun CharSequence.elementAt(index: Int): Char

Returns a character at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this char sequence.

actual inline fun CharSequence.elementAt(index: Int): Char
actual inline fun CharSequence.elementAt(index: Int): Char
actual inline fun CharSequence.elementAt(index: Int): Char

Returns a character at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this char sequence.

Link copied to clipboard
inline fun CharSequence.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char
inline fun CharSequence.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char
inline fun CharSequence.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char

Returns a character at the given index or the result of calling the defaultValue function if the index is out of bounds of this char sequence.

Link copied to clipboard
inline fun CharSequence.elementAtOrNull(index: Int): Char?
inline fun CharSequence.elementAtOrNull(index: Int): Char?
inline fun CharSequence.elementAtOrNull(index: Int): Char?

Returns a character at the given index or null if the index is out of bounds of this char sequence.

Link copied to clipboard

Encodes this string to an array of bytes in UTF-8 encoding.

expect fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray
expect fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray
expect fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray

Encodes this string or its substring to an array of bytes in UTF-8 encoding.

Encodes this string to an array of bytes in UTF-8 encoding.

actual fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray
actual fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray
actual fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray

Encodes this string or its substring to an array of bytes in UTF-8 encoding.

Encodes this string to an array of bytes in UTF-8 encoding.

actual fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray
actual fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray
actual fun String.encodeToByteArray(    startIndex: Int = 0,     endIndex: Int = this.length,     throwOnInvalidSequence: Boolean = false): ByteArray

Encodes this string or its substring to an array of bytes in UTF-8 encoding.

Encodes this string to an array of bytes in UTF-8 encoding.

actual fun String.encodeToByteArray(    startIndex: Int,     endIndex: Int,     throwOnInvalidSequence: Boolean): ByteArray
actual fun String.encodeToByteArray(    startIndex: Int,     endIndex: Int,     throwOnInvalidSequence: Boolean): ByteArray
actual fun String.encodeToByteArray(    startIndex: Int,     endIndex: Int,     throwOnInvalidSequence: Boolean): ByteArray

Encodes this string or its substring to an array of bytes in UTF-8 encoding.

Link copied to clipboard
expect fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean
expect fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean
expect fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean
fun CharSequence.endsWith(char: Char, ignoreCase: Boolean = false): Boolean
fun CharSequence.endsWith(char: Char, ignoreCase: Boolean = false): Boolean
fun CharSequence.endsWith(char: Char, ignoreCase: Boolean = false): Boolean

Returns true if this char sequence ends with the specified character.

fun CharSequence.endsWith(suffix: CharSequence, ignoreCase: Boolean = false): Boolean
fun CharSequence.endsWith(suffix: CharSequence, ignoreCase: Boolean = false): Boolean
fun CharSequence.endsWith(suffix: CharSequence, ignoreCase: Boolean = false): Boolean

Returns true if this char sequence ends with the specified suffix.

actual fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean
actual fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean
actual fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean

Returns true if this string ends with the specified suffix.

actual fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean
actual fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean
actual fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean

Returns true if this string ends with the specified suffix.

actual fun String.endsWith(suffix: String, ignoreCase: Boolean): Boolean
actual fun String.endsWith(suffix: String, ignoreCase: Boolean): Boolean
actual fun String.endsWith(suffix: String, ignoreCase: Boolean): Boolean

Returns true if this string ends with the specified suffix.

Link copied to clipboard
expect fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean
expect fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean
expect fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean

Returns true if this string is equal to other, optionally ignoring character case.

actual fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean
actual fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean
actual fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean

Returns true if this string is equal to other, optionally ignoring character case.

actual fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean
actual fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean
actual fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean
actual fun String?.equals(other: String?, ignoreCase: Boolean): Boolean
actual fun String?.equals(other: String?, ignoreCase: Boolean): Boolean
actual fun String?.equals(other: String?, ignoreCase: Boolean): Boolean

Returns true if this string is equal to other, optionally ignoring character case.

Link copied to clipboard
inline fun String.filter(predicate: (Char) -> Boolean): String
inline fun String.filter(predicate: (Char) -> Boolean): String
inline fun String.filter(predicate: (Char) -> Boolean): String

Returns a string containing only those characters from the original string that match the given predicate.

inline fun CharSequence.filter(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.filter(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.filter(predicate: (Char) -> Boolean): CharSequence

Returns a char sequence containing only those characters from the original char sequence that match the given predicate.

Link copied to clipboard
inline fun String.filterIndexed(predicate: (index: Int, Char) -> Boolean): String
inline fun String.filterIndexed(predicate: (index: Int, Char) -> Boolean): String
inline fun String.filterIndexed(predicate: (index: Int, Char) -> Boolean): String

Returns a string containing only those characters from the original string that match the given predicate.

inline fun CharSequence.filterIndexed(predicate: (index: Int, Char) -> Boolean): CharSequence
inline fun CharSequence.filterIndexed(predicate: (index: Int, Char) -> Boolean): CharSequence
inline fun CharSequence.filterIndexed(predicate: (index: Int, Char) -> Boolean): CharSequence

Returns a char sequence containing only those characters from the original char sequence that match the given predicate.

Link copied to clipboard
inline fun <C : Appendable> CharSequence.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C
inline fun <C : Appendable> CharSequence.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C
inline fun <C : Appendable> CharSequence.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C

Appends all characters matching the given predicate to the given destination.

Link copied to clipboard
inline fun String.filterNot(predicate: (Char) -> Boolean): String
inline fun String.filterNot(predicate: (Char) -> Boolean): String
inline fun String.filterNot(predicate: (Char) -> Boolean): String

Returns a string containing only those characters from the original string that do not match the given predicate.

inline fun CharSequence.filterNot(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.filterNot(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.filterNot(predicate: (Char) -> Boolean): CharSequence

Returns a char sequence containing only those characters from the original char sequence that do not match the given predicate.

Link copied to clipboard
inline fun <C : Appendable> CharSequence.filterNotTo(destination: C, predicate: (Char) -> Boolean): C
inline fun <C : Appendable> CharSequence.filterNotTo(destination: C, predicate: (Char) -> Boolean): C
inline fun <C : Appendable> CharSequence.filterNotTo(destination: C, predicate: (Char) -> Boolean): C

Appends all characters not matching the given predicate to the given destination.

Link copied to clipboard
inline fun <C : Appendable> CharSequence.filterTo(destination: C, predicate: (Char) -> Boolean): C
inline fun <C : Appendable> CharSequence.filterTo(destination: C, predicate: (Char) -> Boolean): C
inline fun <C : Appendable> CharSequence.filterTo(destination: C, predicate: (Char) -> Boolean): C

Appends all characters matching the given predicate to the given destination.

Link copied to clipboard
inline fun CharSequence.find(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.find(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.find(predicate: (Char) -> Boolean): Char?

Returns the first character matching the given predicate, or null if no such character was found.

Link copied to clipboard
fun CharSequence.findAnyOf(    strings: Collection<String>,     startIndex: Int = 0,     ignoreCase: Boolean = false): Pair<Int, String>?
fun CharSequence.findAnyOf(    strings: Collection<String>,     startIndex: Int = 0,     ignoreCase: Boolean = false): Pair<Int, String>?
fun CharSequence.findAnyOf(    strings: Collection<String>,     startIndex: Int = 0,     ignoreCase: Boolean = false): Pair<Int, String>?

Finds the first occurrence of any of the specified strings in this char sequence, starting from the specified startIndex and optionally ignoring the case.

Link copied to clipboard
inline fun CharSequence.findLast(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.findLast(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.findLast(predicate: (Char) -> Boolean): Char?

Returns the last character matching the given predicate, or null if no such character was found.

Link copied to clipboard
fun CharSequence.findLastAnyOf(    strings: Collection<String>,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Pair<Int, String>?
fun CharSequence.findLastAnyOf(    strings: Collection<String>,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Pair<Int, String>?
fun CharSequence.findLastAnyOf(    strings: Collection<String>,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Pair<Int, String>?

Finds the last occurrence of any of the specified strings in this char sequence, starting from the specified startIndex and optionally ignoring the case.

Link copied to clipboard

Returns first character.

inline fun CharSequence.first(predicate: (Char) -> Boolean): Char
inline fun CharSequence.first(predicate: (Char) -> Boolean): Char
inline fun CharSequence.first(predicate: (Char) -> Boolean): Char

Returns the first character matching the given predicate.

Link copied to clipboard
inline fun <R : Any> CharSequence.firstNotNullOf(transform: (Char) -> R?): R
inline fun <R : Any> CharSequence.firstNotNullOf(transform: (Char) -> R?): R
inline fun <R : Any> CharSequence.firstNotNullOf(transform: (Char) -> R?): R

Returns the first non-null value produced by transform function being applied to characters of this char sequence in iteration order, or throws NoSuchElementException if no non-null value was produced.

Link copied to clipboard
inline fun <R : Any> CharSequence.firstNotNullOfOrNull(transform: (Char) -> R?): R?
inline fun <R : Any> CharSequence.firstNotNullOfOrNull(transform: (Char) -> R?): R?
inline fun <R : Any> CharSequence.firstNotNullOfOrNull(transform: (Char) -> R?): R?

Returns the first non-null value produced by transform function being applied to characters of this char sequence in iteration order, or null if no non-null value was produced.

Link copied to clipboard

Returns the first character, or null if the char sequence is empty.

inline fun CharSequence.firstOrNull(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.firstOrNull(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.firstOrNull(predicate: (Char) -> Boolean): Char?

Returns the first character matching the given predicate, or null if character was not found.

Link copied to clipboard
inline fun <R> CharSequence.flatMap(transform: (Char) -> Iterable<R>): List<R>
inline fun <R> CharSequence.flatMap(transform: (Char) -> Iterable<R>): List<R>
inline fun <R> CharSequence.flatMap(transform: (Char) -> Iterable<R>): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each character of original char sequence.

Link copied to clipboard
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> CharSequence.flatMapIndexed(transform: (index: Int, Char) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> CharSequence.flatMapIndexed(transform: (index: Int, Char) -> Iterable<R>): List<R>
@JvmName(name = "flatMapIndexedIterable")
inline fun <R> CharSequence.flatMapIndexed(transform: (index: Int, Char) -> Iterable<R>): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each character and its index in the original char sequence.

Link copied to clipboard
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapIndexedTo(destination: C, transform: (index: Int, Char) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapIndexedTo(destination: C, transform: (index: Int, Char) -> Iterable<R>): C
@JvmName(name = "flatMapIndexedIterableTo")
inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapIndexedTo(destination: C, transform: (index: Int, Char) -> Iterable<R>): C

Appends all elements yielded from results of transform function being invoked on each character and its index in the original char sequence, to the given destination.

Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapTo(destination: C, transform: (Char) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapTo(destination: C, transform: (Char) -> Iterable<R>): C
inline fun <R, C : MutableCollection<in R>> CharSequence.flatMapTo(destination: C, transform: (Char) -> Iterable<R>): C

Appends all elements yielded from results of transform function being invoked on each character of original char sequence, to the given destination.

Link copied to clipboard
inline fun <R> CharSequence.fold(initial: R, operation: (acc: R, Char) -> R): R
inline fun <R> CharSequence.fold(initial: R, operation: (acc: R, Char) -> R): R
inline fun <R> CharSequence.fold(initial: R, operation: (acc: R, Char) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each character.

Link copied to clipboard
inline fun <R> CharSequence.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): R
inline fun <R> CharSequence.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): R
inline fun <R> CharSequence.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each character with its index in the original char sequence.

Link copied to clipboard
inline fun <R> CharSequence.foldRight(initial: R, operation: (Char, acc: R) -> R): R
inline fun <R> CharSequence.foldRight(initial: R, operation: (Char, acc: R) -> R): R
inline fun <R> CharSequence.foldRight(initial: R, operation: (Char, acc: R) -> R): R

Accumulates value starting with initial value and applying operation from right to left to each character and current accumulator value.

Link copied to clipboard
inline fun <R> CharSequence.foldRightIndexed(initial: R, operation: (index: Int, Char, acc: R) -> R): R
inline fun <R> CharSequence.foldRightIndexed(initial: R, operation: (index: Int, Char, acc: R) -> R): R
inline fun <R> CharSequence.foldRightIndexed(initial: R, operation: (index: Int, Char, acc: R) -> R): R

Accumulates value starting with initial value and applying operation from right to left to each character with its index in the original char sequence and current accumulator value.

Link copied to clipboard
inline fun CharSequence.forEach(action: (Char) -> Unit)
inline fun CharSequence.forEach(action: (Char) -> Unit)
inline fun CharSequence.forEach(action: (Char) -> Unit)

Performs the given action on each character.

Link copied to clipboard
inline fun CharSequence.forEachIndexed(action: (index: Int, Char) -> Unit)
inline fun CharSequence.forEachIndexed(action: (index: Int, Char) -> Unit)
inline fun CharSequence.forEachIndexed(action: (index: Int, Char) -> Unit)

Performs the given action on each character, providing sequential index with the character.

Link copied to clipboard
inline fun String.format(vararg args: Any?): String
inline fun String.format(vararg args: Any?): String
inline fun String.format(vararg args: Any?): String

Uses this string as a format string and returns a string obtained by substituting the specified arguments, using the default locale.

inline fun String.format(locale: Locale, vararg args: Any?): String
inline fun String.format(locale: Locale, vararg args: Any?): String
inline fun String.format(locale: Locale, vararg args: Any?): String

Uses this string as a format string and returns a string obtained by substituting the specified arguments, using the specified locale.

@JvmName(name = "formatNullable")
inline fun String.format(locale: Locale?, vararg args: Any?): String
@JvmName(name = "formatNullable")
inline fun String.format(locale: Locale?, vararg args: Any?): String
@JvmName(name = "formatNullable")
inline fun String.format(locale: Locale?, vararg args: Any?): String

Uses this string as a format string and returns a string obtained by substituting the specified arguments, using the specified locale. If locale is null then no localization is applied.

Link copied to clipboard
inline fun CharSequence.getOrElse(index: Int, defaultValue: (Int) -> Char): Char
inline fun CharSequence.getOrElse(index: Int, defaultValue: (Int) -> Char): Char
inline fun CharSequence.getOrElse(index: Int, defaultValue: (Int) -> Char): Char

Returns a character at the given index or the result of calling the defaultValue function if the index is out of bounds of this char sequence.

Link copied to clipboard

Returns a character at the given index or null if the index is out of bounds of this char sequence.

Link copied to clipboard
inline fun <K> CharSequence.groupBy(keySelector: (Char) -> K): Map<K, List<Char>>
inline fun <K> CharSequence.groupBy(keySelector: (Char) -> K): Map<K, List<Char>>
inline fun <K> CharSequence.groupBy(keySelector: (Char) -> K): Map<K, List<Char>>

Groups characters of the original char sequence by the key returned by the given keySelector function applied to each character and returns a map where each group key is associated with a list of corresponding characters.

inline fun <K, V> CharSequence.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, List<V>>
inline fun <K, V> CharSequence.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, List<V>>
inline fun <K, V> CharSequence.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, List<V>>

Groups values returned by the valueTransform function applied to each character of the original char sequence by the key returned by the given keySelector function applied to the character and returns a map where each group key is associated with a list of corresponding values.

Link copied to clipboard
inline fun <K, M : MutableMap<in K, MutableList<Char>>> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Char>>> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K): M
inline fun <K, M : MutableMap<in K, MutableList<Char>>> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K): M

Groups characters of the original char sequence by the key returned by the given keySelector function applied to each character and puts to the destination map each group key associated with a list of corresponding characters.

inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharSequence.groupByTo(    destination: M,     keySelector: (Char) -> K,     valueTransform: (Char) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharSequence.groupByTo(    destination: M,     keySelector: (Char) -> K,     valueTransform: (Char) -> V): M
inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharSequence.groupByTo(    destination: M,     keySelector: (Char) -> K,     valueTransform: (Char) -> V): M

Groups values returned by the valueTransform function applied to each character of the original char sequence by the key returned by the given keySelector function applied to the character and puts to the destination map each group key associated with a list of corresponding values.

Link copied to clipboard
inline fun <K> CharSequence.groupingBy(crossinline keySelector: (Char) -> K): Grouping<Char, K>
inline fun <K> CharSequence.groupingBy(crossinline keySelector: (Char) -> K): Grouping<Char, K>
inline fun <K> CharSequence.groupingBy(crossinline keySelector: (Char) -> K): Grouping<Char, K>

Creates a Grouping source from a char sequence to be used later with one of group-and-fold operations using the specified keySelector function to extract a key from each character.

Link copied to clipboard

Returns true if this CharSequence has Unicode surrogate pair at the specified index.

Link copied to clipboard
fun CharSequence.indexOf(    char: Char,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int
fun CharSequence.indexOf(    char: Char,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int
fun CharSequence.indexOf(    char: Char,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int

Returns the index within this string of the first occurrence of the specified character, starting from the specified startIndex.

fun CharSequence.indexOf(    string: String,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int
fun CharSequence.indexOf(    string: String,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int
fun CharSequence.indexOf(    string: String,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int

Returns the index within this char sequence of the first occurrence of the specified string, starting from the specified startIndex.

Link copied to clipboard
fun CharSequence.indexOfAny(    chars: CharArray,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int
fun CharSequence.indexOfAny(    chars: CharArray,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int
fun CharSequence.indexOfAny(    chars: CharArray,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int

Finds the index of the first occurrence of any of the specified chars in this char sequence, starting from the specified startIndex and optionally ignoring the case.

fun CharSequence.indexOfAny(    strings: Collection<String>,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int
fun CharSequence.indexOfAny(    strings: Collection<String>,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int
fun CharSequence.indexOfAny(    strings: Collection<String>,     startIndex: Int = 0,     ignoreCase: Boolean = false): Int

Finds the index of the first occurrence of any of the specified strings in this char sequence, starting from the specified startIndex and optionally ignoring the case.

Link copied to clipboard
inline fun CharSequence.indexOfFirst(predicate: (Char) -> Boolean): Int
inline fun CharSequence.indexOfFirst(predicate: (Char) -> Boolean): Int
inline fun CharSequence.indexOfFirst(predicate: (Char) -> Boolean): Int

Returns index of the first character matching the given predicate, or -1 if the char sequence does not contain such character.

Link copied to clipboard
inline fun CharSequence.indexOfLast(predicate: (Char) -> Boolean): Int
inline fun CharSequence.indexOfLast(predicate: (Char) -> Boolean): Int
inline fun CharSequence.indexOfLast(predicate: (Char) -> Boolean): Int

Returns index of the last character matching the given predicate, or -1 if the char sequence does not contain such character.

Link copied to clipboard

Returns the range of valid character indices for this char sequence.

Link copied to clipboard
inline fun String.intern(): String
inline fun String.intern(): String
inline fun String.intern(): String

Returns a canonical representation for this string object.

Link copied to clipboard

Returns true if this string is empty or consists solely of whitespace characters.

actual fun CharSequence.isBlank(): Boolean
actual fun CharSequence.isBlank(): Boolean
actual fun CharSequence.isBlank(): Boolean

Returns true if this string is empty or consists solely of whitespace characters.

Link copied to clipboard

Returns true if this char sequence is empty (contains no characters).

Link copied to clipboard

Returns true if this char sequence is not empty and contains some characters except of whitespace characters.

Link copied to clipboard

Returns true if this char sequence is not empty.

Link copied to clipboard

Returns true if this nullable char sequence is either null or empty or consists solely of whitespace characters.

Link copied to clipboard

Returns true if this nullable char sequence is either null or empty.

Link copied to clipboard

Iterator for characters of the given char sequence.

Link copied to clipboard

Returns the last character.

inline fun CharSequence.last(predicate: (Char) -> Boolean): Char
inline fun CharSequence.last(predicate: (Char) -> Boolean): Char
inline fun CharSequence.last(predicate: (Char) -> Boolean): Char

Returns the last character matching the given predicate.

Link copied to clipboard

Returns the index of the last character in the char sequence or -1 if it is empty.

Link copied to clipboard
fun CharSequence.lastIndexOf(    char: Char,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int
fun CharSequence.lastIndexOf(    char: Char,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int
fun CharSequence.lastIndexOf(    char: Char,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int

Returns the index within this char sequence of the last occurrence of the specified character, starting from the specified startIndex.

fun CharSequence.lastIndexOf(    string: String,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int
fun CharSequence.lastIndexOf(    string: String,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int
fun CharSequence.lastIndexOf(    string: String,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int

Returns the index within this char sequence of the last occurrence of the specified string, starting from the specified startIndex.

Link copied to clipboard
fun CharSequence.lastIndexOfAny(    chars: CharArray,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int
fun CharSequence.lastIndexOfAny(    chars: CharArray,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int
fun CharSequence.lastIndexOfAny(    chars: CharArray,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int

Finds the index of the last occurrence of any of the specified chars in this char sequence, starting from the specified startIndex and optionally ignoring the case.

fun CharSequence.lastIndexOfAny(    strings: Collection<String>,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int
fun CharSequence.lastIndexOfAny(    strings: Collection<String>,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int
fun CharSequence.lastIndexOfAny(    strings: Collection<String>,     startIndex: Int = lastIndex,     ignoreCase: Boolean = false): Int

Finds the index of the last occurrence of any of the specified strings in this char sequence, starting from the specified startIndex and optionally ignoring the case.

Link copied to clipboard

Returns the last character, or null if the char sequence is empty.

inline fun CharSequence.lastOrNull(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.lastOrNull(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.lastOrNull(predicate: (Char) -> Boolean): Char?

Returns the last character matching the given predicate, or null if no such character was found.

Link copied to clipboard

Splits this char sequence to a list of lines delimited by any of the following character sequences: CRLF, LF or CR.

Link copied to clipboard

Splits this char sequence to a sequence of lines delimited by any of the following character sequences: CRLF, LF or CR.

Link copied to clipboard
expect fun String.lowercase(): String
expect fun String.lowercase(): String
expect fun String.lowercase(): String

Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.

inline fun String.lowercase(locale: Locale): String
inline fun String.lowercase(locale: Locale): String
inline fun String.lowercase(locale: Locale): String

Returns a copy of this string converted to lower case using the rules of the specified locale.

actual inline fun String.lowercase(): String
actual inline fun String.lowercase(): String
actual inline fun String.lowercase(): String

Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.

actual inline fun String.lowercase(): String
actual inline fun String.lowercase(): String
actual inline fun String.lowercase(): String

Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.

actual fun String.lowercase(): String
actual fun String.lowercase(): String
actual fun String.lowercase(): String

Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.

Link copied to clipboard
inline fun <R> CharSequence.map(transform: (Char) -> R): List<R>
inline fun <R> CharSequence.map(transform: (Char) -> R): List<R>
inline fun <R> CharSequence.map(transform: (Char) -> R): List<R>

Returns a list containing the results of applying the given transform function to each character in the original char sequence.

Link copied to clipboard
inline fun <R> CharSequence.mapIndexed(transform: (index: Int, Char) -> R): List<R>
inline fun <R> CharSequence.mapIndexed(transform: (index: Int, Char) -> R): List<R>
inline fun <R> CharSequence.mapIndexed(transform: (index: Int, Char) -> R): List<R>

Returns a list containing the results of applying the given transform function to each character and its index in the original char sequence.

Link copied to clipboard
inline fun <R : Any> CharSequence.mapIndexedNotNull(transform: (index: Int, Char) -> R?): List<R>
inline fun <R : Any> CharSequence.mapIndexedNotNull(transform: (index: Int, Char) -> R?): List<R>
inline fun <R : Any> CharSequence.mapIndexedNotNull(transform: (index: Int, Char) -> R?): List<R>

Returns a list containing only the non-null results of applying the given transform function to each character and its index in the original char sequence.

Link copied to clipboard
inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapIndexedNotNullTo(destination: C, transform: (index: Int, Char) -> R?): C
inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapIndexedNotNullTo(destination: C, transform: (index: Int, Char) -> R?): C
inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapIndexedNotNullTo(destination: C, transform: (index: Int, Char) -> R?): C

Applies the given transform function to each character and its index in the original char sequence and appends only the non-null results to the given destination.

Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> CharSequence.mapIndexedTo(destination: C, transform: (index: Int, Char) -> R): C
inline fun <R, C : MutableCollection<in R>> CharSequence.mapIndexedTo(destination: C, transform: (index: Int, Char) -> R): C
inline fun <R, C : MutableCollection<in R>> CharSequence.mapIndexedTo(destination: C, transform: (index: Int, Char) -> R): C

Applies the given transform function to each character and its index in the original char sequence and appends the results to the given destination.

Link copied to clipboard
inline fun <R : Any> CharSequence.mapNotNull(transform: (Char) -> R?): List<R>
inline fun <R : Any> CharSequence.mapNotNull(transform: (Char) -> R?): List<R>
inline fun <R : Any> CharSequence.mapNotNull(transform: (Char) -> R?): List<R>

Returns a list containing only the non-null results of applying the given transform function to each character in the original char sequence.

Link copied to clipboard
inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapNotNullTo(destination: C, transform: (Char) -> R?): C
inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapNotNullTo(destination: C, transform: (Char) -> R?): C
inline fun <R : Any, C : MutableCollection<in R>> CharSequence.mapNotNullTo(destination: C, transform: (Char) -> R?): C

Applies the given transform function to each character in the original char sequence and appends only the non-null results to the given destination.

Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> CharSequence.mapTo(destination: C, transform: (Char) -> R): C
inline fun <R, C : MutableCollection<in R>> CharSequence.mapTo(destination: C, transform: (Char) -> R): C
inline fun <R, C : MutableCollection<in R>> CharSequence.mapTo(destination: C, transform: (Char) -> R): C

Applies the given transform function to each character of the original char sequence and appends the results to the given destination.

Link copied to clipboard
inline fun String.match(regex: String): Array<String>?
inline fun String.match(regex: String): Array<String>?
inline fun String.match(regex: String): Array<String>?
Link copied to clipboard
infix inline fun CharSequence.matches(regex: Regex): Boolean
infix inline fun CharSequence.matches(regex: Regex): Boolean
infix inline fun CharSequence.matches(regex: Regex): Boolean

Returns true if this char sequence matches the given regular expression.

fun String.matches(regex: String): Boolean
fun String.matches(regex: String): Boolean
fun String.matches(regex: String): Boolean
Link copied to clipboard
Link copied to clipboard
inline fun <R : Comparable<R>> CharSequence.maxBy(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> CharSequence.maxBy(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> CharSequence.maxBy(selector: (Char) -> R): Char?
Link copied to clipboard
inline fun <R : Comparable<R>> CharSequence.maxByOrNull(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> CharSequence.maxByOrNull(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> CharSequence.maxByOrNull(selector: (Char) -> R): Char?

Returns the first character yielding the largest value of the given function or null if there are no characters.

Link copied to clipboard
inline fun CharSequence.maxOf(selector: (Char) -> Double): Double
inline fun CharSequence.maxOf(selector: (Char) -> Float): Float
inline fun <R : Comparable<R>> CharSequence.maxOf(selector: (Char) -> R): R
inline fun CharSequence.maxOf(selector: (Char) -> Double): Double
inline fun CharSequence.maxOf(selector: (Char) -> Float): Float
inline fun <R : Comparable<R>> CharSequence.maxOf(selector: (Char) -> R): R
inline fun CharSequence.maxOf(selector: (Char) -> Double): Double
inline fun CharSequence.maxOf(selector: (Char) -> Float): Float
inline fun <R : Comparable<R>> CharSequence.maxOf(selector: (Char) -> R): R

Returns the largest value among all values produced by selector function applied to each character in the char sequence.

Link copied to clipboard
inline fun CharSequence.maxOfOrNull(selector: (Char) -> Double): Double?
inline fun CharSequence.maxOfOrNull(selector: (Char) -> Float): Float?
inline fun <R : Comparable<R>> CharSequence.maxOfOrNull(selector: (Char) -> R): R?
inline fun CharSequence.maxOfOrNull(selector: (Char) -> Double): Double?
inline fun CharSequence.maxOfOrNull(selector: (Char) -> Float): Float?
inline fun <R : Comparable<R>> CharSequence.maxOfOrNull(selector: (Char) -> R): R?
inline fun CharSequence.maxOfOrNull(selector: (Char) -> Double): Double?
inline fun CharSequence.maxOfOrNull(selector: (Char) -> Float): Float?
inline fun <R : Comparable<R>> CharSequence.maxOfOrNull(selector: (Char) -> R): R?

Returns the largest value among all values produced by selector function applied to each character in the char sequence or null if there are no characters.

Link copied to clipboard
inline fun <R> CharSequence.maxOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R
inline fun <R> CharSequence.maxOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R
inline fun <R> CharSequence.maxOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R

Returns the largest value according to the provided comparator among all values produced by selector function applied to each character in the char sequence.

Link copied to clipboard
inline fun <R> CharSequence.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Char) -> R): R?
inline fun <R> CharSequence.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Char) -> R): R?
inline fun <R> CharSequence.maxOfWithOrNull(comparator: Comparator<in R>, selector: (Char) -> R): R?

Returns the largest value according to the provided comparator among all values produced by selector function applied to each character in the char sequence or null if there are no characters.

Link copied to clipboard

Returns the largest character or null if there are no characters.

Link copied to clipboard
fun CharSequence.maxWith(comparator: Comparator<in Char>): Char?
fun CharSequence.maxWith(comparator: Comparator<in Char>): Char?
fun CharSequence.maxWith(comparator: Comparator<in Char>): Char?
Link copied to clipboard

Returns the first character having the largest value according to the provided comparator or null if there are no characters.

Link copied to clipboard
Link copied to clipboard
inline fun <R : Comparable<R>> CharSequence.minBy(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> CharSequence.minBy(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> CharSequence.minBy(selector: (Char) -> R): Char?
Link copied to clipboard
inline fun <R : Comparable<R>> CharSequence.minByOrNull(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> CharSequence.minByOrNull(selector: (Char) -> R): Char?
inline fun <R : Comparable<R>> CharSequence.minByOrNull(selector: (Char) -> R): Char?

Returns the first character yielding the smallest value of the given function or null if there are no characters.

Link copied to clipboard
inline fun CharSequence.minOf(selector: (Char) -> Double): Double
inline fun CharSequence.minOf(selector: (Char) -> Float): Float
inline fun <R : Comparable<R>> CharSequence.minOf(selector: (Char) -> R): R
inline fun CharSequence.minOf(selector: (Char) -> Double): Double
inline fun CharSequence.minOf(selector: (Char) -> Float): Float
inline fun <R : Comparable<R>> CharSequence.minOf(selector: (Char) -> R): R
inline fun CharSequence.minOf(selector: (Char) -> Double): Double
inline fun CharSequence.minOf(selector: (Char) -> Float): Float
inline fun <R : Comparable<R>> CharSequence.minOf(selector: (Char) -> R): R

Returns the smallest value among all values produced by selector function applied to each character in the char sequence.

Link copied to clipboard
inline fun CharSequence.minOfOrNull(selector: (Char) -> Double): Double?
inline fun CharSequence.minOfOrNull(selector: (Char) -> Float): Float?
inline fun <R : Comparable<R>> CharSequence.minOfOrNull(selector: (Char) -> R): R?
inline fun CharSequence.minOfOrNull(selector: (Char) -> Double): Double?
inline fun CharSequence.minOfOrNull(selector: (Char) -> Float): Float?
inline fun <R : Comparable<R>> CharSequence.minOfOrNull(selector: (Char) -> R): R?
inline fun CharSequence.minOfOrNull(selector: (Char) -> Double): Double?
inline fun CharSequence.minOfOrNull(selector: (Char) -> Float): Float?
inline fun <R : Comparable<R>> CharSequence.minOfOrNull(selector: (Char) -> R): R?

Returns the smallest value among all values produced by selector function applied to each character in the char sequence or null if there are no characters.

Link copied to clipboard
inline fun <R> CharSequence.minOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R
inline fun <R> CharSequence.minOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R
inline fun <R> CharSequence.minOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R

Returns the smallest value according to the provided comparator among all values produced by selector function applied to each character in the char sequence.

Link copied to clipboard
inline fun <R> CharSequence.minOfWithOrNull(comparator: Comparator<in R>, selector: (Char) -> R): R?
inline fun <R> CharSequence.minOfWithOrNull(comparator: Comparator<in R>, selector: (Char) -> R): R?
inline fun <R> CharSequence.minOfWithOrNull(comparator: Comparator<in R>, selector: (Char) -> R): R?

Returns the smallest value according to the provided comparator among all values produced by selector function applied to each character in the char sequence or null if there are no characters.

Link copied to clipboard

Returns the smallest character or null if there are no characters.

Link copied to clipboard
fun CharSequence.minWith(comparator: Comparator<in Char>): Char?
fun CharSequence.minWith(comparator: Comparator<in Char>): Char?
fun CharSequence.minWith(comparator: Comparator<in Char>): Char?
Link copied to clipboard

Returns the first character having the smallest value according to the provided comparator or null if there are no characters.

Link copied to clipboard

Returns true if the char sequence has no characters.

inline fun CharSequence.none(predicate: (Char) -> Boolean): Boolean
inline fun CharSequence.none(predicate: (Char) -> Boolean): Boolean
inline fun CharSequence.none(predicate: (Char) -> Boolean): Boolean

Returns true if no characters match the given predicate.

Link copied to clipboard
inline fun String.offsetByCodePoints(index: Int, codePointOffset: Int): Int
inline fun String.offsetByCodePoints(index: Int, codePointOffset: Int): Int
inline fun String.offsetByCodePoints(index: Int, codePointOffset: Int): Int

Returns the index within this string that is offset from the given index by codePointOffset code points.

Link copied to clipboard
inline fun String?.orEmpty(): String
inline fun String?.orEmpty(): String
inline fun String?.orEmpty(): String

Returns the string if it is not null, or the empty string otherwise.

Link copied to clipboard
fun String.padEnd(length: Int, padChar: Char = ' '): String
fun String.padEnd(length: Int, padChar: Char = ' '): String
fun String.padEnd(length: Int, padChar: Char = ' '): String

Pads the string to the specified length at the end with the specified character or space.

fun CharSequence.padEnd(length: Int, padChar: Char = ' '): CharSequence
fun CharSequence.padEnd(length: Int, padChar: Char = ' '): CharSequence
fun CharSequence.padEnd(length: Int, padChar: Char = ' '): CharSequence

Returns a char sequence with content of this char sequence padded at the end to the specified length with the specified character or space.

Link copied to clipboard
fun String.padStart(length: Int, padChar: Char = ' '): String
fun String.padStart(length: Int, padChar: Char = ' '): String
fun String.padStart(length: Int, padChar: Char = ' '): String

Pads the string to the specified length at the beginning with the specified character or space.

fun CharSequence.padStart(length: Int, padChar: Char = ' '): CharSequence
fun CharSequence.padStart(length: Int, padChar: Char = ' '): CharSequence
fun CharSequence.padStart(length: Int, padChar: Char = ' '): CharSequence

Returns a char sequence with content of this char sequence padded at the beginning to the specified length with the specified character or space.

Link copied to clipboard
inline fun String.partition(predicate: (Char) -> Boolean): Pair<String, String>
inline fun String.partition(predicate: (Char) -> Boolean): Pair<String, String>
inline fun String.partition(predicate: (Char) -> Boolean): Pair<String, String>

Splits the original string into pair of strings, where first string contains characters for which predicate yielded true, while second string contains characters for which predicate yielded false.

Splits the original char sequence into pair of char sequences, where first char sequence contains characters for which predicate yielded true, while second char sequence contains characters for which predicate yielded false.

Link copied to clipboard
operator fun String?.plus(other: Any?): String
operator fun String?.plus(other: Any?): String
operator fun String?.plus(other: Any?): String

Concatenates this string with the string representation of the given other object. If either the receiver or the other object are null, they are represented as the string "null".

operator fun String?.plus(other: Any?): String
operator fun String?.plus(other: Any?): String
operator fun String?.plus(other: Any?): String

Concatenates this string with the string representation of the given other object. If either the receiver or the other object are null, they are represented as the string "null".

inline operator fun String?.plus(other: Any?): String
inline operator fun String?.plus(other: Any?): String
inline operator fun String?.plus(other: Any?): String
Link copied to clipboard
fun String.prependIndent(indent: String = " "): String
fun String.prependIndent(indent: String = " "): String
fun String.prependIndent(indent: String = " "): String

Prepends indent to every line of the original string.

Link copied to clipboard
inline fun CharSequence.random(): Char
inline fun CharSequence.random(): Char
inline fun CharSequence.random(): Char

Returns a random character from this char sequence.

Returns a random character from this char sequence using the specified source of randomness.

Link copied to clipboard

Returns a random character from this char sequence, or null if this char sequence is empty.

Returns a random character from this char sequence using the specified source of randomness, or null if this char sequence is empty.

Link copied to clipboard
inline fun String.reader(): StringReader
inline fun String.reader(): StringReader
inline fun String.reader(): StringReader

Creates a new reader for the string.

Link copied to clipboard
inline fun CharSequence.reduce(operation: (acc: Char, Char) -> Char): Char
inline fun CharSequence.reduce(operation: (acc: Char, Char) -> Char): Char
inline fun CharSequence.reduce(operation: (acc: Char, Char) -> Char): Char

Accumulates value starting with the first character and applying operation from left to right to current accumulator value and each character.

Link copied to clipboard
inline fun CharSequence.reduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): Char
inline fun CharSequence.reduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): Char
inline fun CharSequence.reduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): Char

Accumulates value starting with the first character and applying operation from left to right to current accumulator value and each character with its index in the original char sequence.

Link copied to clipboard
inline fun CharSequence.reduceIndexedOrNull(operation: (index: Int, acc: Char, Char) -> Char): Char?
inline fun CharSequence.reduceIndexedOrNull(operation: (index: Int, acc: Char, Char) -> Char): Char?
inline fun CharSequence.reduceIndexedOrNull(operation: (index: Int, acc: Char, Char) -> Char): Char?

Accumulates value starting with the first character and applying operation from left to right to current accumulator value and each character with its index in the original char sequence.

Link copied to clipboard
inline fun CharSequence.reduceOrNull(operation: (acc: Char, Char) -> Char): Char?
inline fun CharSequence.reduceOrNull(operation: (acc: Char, Char) -> Char): Char?
inline fun CharSequence.reduceOrNull(operation: (acc: Char, Char) -> Char): Char?

Accumulates value starting with the first character and applying operation from left to right to current accumulator value and each character.

Link copied to clipboard
inline fun CharSequence.reduceRight(operation: (Char, acc: Char) -> Char): Char
inline fun CharSequence.reduceRight(operation: (Char, acc: Char) -> Char): Char
inline fun CharSequence.reduceRight(operation: (Char, acc: Char) -> Char): Char

Accumulates value starting with the last character and applying operation from right to left to each character and current accumulator value.

Link copied to clipboard
inline fun CharSequence.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char
inline fun CharSequence.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char
inline fun CharSequence.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char

Accumulates value starting with the last character and applying operation from right to left to each character with its index in the original char sequence and current accumulator value.

Link copied to clipboard
inline fun CharSequence.reduceRightIndexedOrNull(operation: (index: Int, Char, acc: Char) -> Char): Char?
inline fun CharSequence.reduceRightIndexedOrNull(operation: (index: Int, Char, acc: Char) -> Char): Char?
inline fun CharSequence.reduceRightIndexedOrNull(operation: (index: Int, Char, acc: Char) -> Char): Char?

Accumulates value starting with the last character and applying operation from right to left to each character with its index in the original char sequence and current accumulator value.

Link copied to clipboard
inline fun CharSequence.reduceRightOrNull(operation: (Char, acc: Char) -> Char): Char?
inline fun CharSequence.reduceRightOrNull(operation: (Char, acc: Char) -> Char): Char?
inline fun CharSequence.reduceRightOrNull(operation: (Char, acc: Char) -> Char): Char?

Accumulates value starting with the last character and applying operation from right to left to each character and current accumulator value.

Link copied to clipboard
Link copied to clipboard
expect fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
expect fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
expect fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean

Returns true if the specified range in this char sequence is equal to the specified range in another char sequence.

fun String.regionMatches(    thisOffset: Int,     other: String,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
fun String.regionMatches(    thisOffset: Int,     other: String,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
fun String.regionMatches(    thisOffset: Int,     other: String,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean

Returns true if the specified range in this string is equal to the specified range in another string.

actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean

Returns true if the specified range in this char sequence is equal to the specified range in another char sequence.

actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
fun String.regionMatches(    thisOffset: Int,     other: String,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
fun String.regionMatches(    thisOffset: Int,     other: String,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean
fun String.regionMatches(    thisOffset: Int,     other: String,     otherOffset: Int,     length: Int,     ignoreCase: Boolean = false): Boolean

Returns true if the specified range in this string is equal to the specified range in another string.

actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean): Boolean
actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean): Boolean
actual fun CharSequence.regionMatches(    thisOffset: Int,     other: CharSequence,     otherOffset: Int,     length: Int,     ignoreCase: Boolean): Boolean

Returns true if the specified range in this char sequence is equal to the specified range in another char sequence.

Link copied to clipboard

If this string starts with the given prefix, returns a copy of this string with the prefix removed. Otherwise, returns this string.

If this char sequence starts with the given prefix, returns a new char sequence with the prefix removed. Otherwise, returns a new char sequence with the same characters.

Link copied to clipboard
inline fun String.removeRange(startIndex: Int, endIndex: Int): String
inline fun String.removeRange(startIndex: Int, endIndex: Int): String
inline fun String.removeRange(startIndex: Int, endIndex: Int): String

Removes the part of a string at a given range.

inline fun String.removeRange(range: IntRange): String
inline fun String.removeRange(range: IntRange): String
inline fun String.removeRange(range: IntRange): String

Removes the part of a string at the given range.

fun CharSequence.removeRange(startIndex: Int, endIndex: Int): CharSequence
fun CharSequence.removeRange(startIndex: Int, endIndex: Int): CharSequence
fun CharSequence.removeRange(startIndex: Int, endIndex: Int): CharSequence

Returns a char sequence with content of this char sequence where its part at the given range is removed.

Returns a char sequence with content of this char sequence where its part at the given range is removed.

Link copied to clipboard

If this string ends with the given suffix, returns a copy of this string with the suffix removed. Otherwise, returns this string.

If this char sequence ends with the given suffix, returns a new char sequence with the suffix removed. Otherwise, returns a new char sequence with the same characters.

Link copied to clipboard

Removes from a string both the given prefix and suffix if and only if it starts with the prefix and ends with the suffix. Otherwise returns this string unchanged.

Removes the given delimiter string from both the start and the end of this string if and only if it starts with and ends with the delimiter. Otherwise returns this string unchanged.

When this char sequence starts with the given prefix and ends with the given suffix, returns a new char sequence having both the given prefix and suffix removed. Otherwise returns a new char sequence with the same characters.

When this char sequence starts with and ends with the given delimiter, returns a new char sequence having this delimiter removed both from the start and end. Otherwise returns a new char sequence with the same characters.

Link copied to clipboard
expect fun CharSequence.repeat(n: Int): String
expect fun CharSequence.repeat(n: Int): String
expect fun CharSequence.repeat(n: Int): String

Returns a string containing this char sequence repeated n times.

actual fun CharSequence.repeat(n: Int): String
actual fun CharSequence.repeat(n: Int): String
actual fun CharSequence.repeat(n: Int): String

Returns a string containing this char sequence repeated n times.

actual fun CharSequence.repeat(n: Int): String
actual fun CharSequence.repeat(n: Int): String
actual fun CharSequence.repeat(n: Int): String

Returns a string containing this char sequence repeated n times.

actual fun CharSequence.repeat(n: Int): String
actual fun CharSequence.repeat(n: Int): String
actual fun CharSequence.repeat(n: Int): String

Returns a string containing this char sequence repeated n times.

Link copied to clipboard
expect fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
expect fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
expect fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String

Returns a new string with all occurrences of oldChar replaced with newChar.

expect fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
expect fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
expect fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String

Returns a new string obtained by replacing all occurrences of the oldValue substring in this string with the specified newValue string.

inline fun CharSequence.replace(regex: Regex, replacement: String): String
inline fun CharSequence.replace(regex: Regex, replacement: String): String
inline fun CharSequence.replace(regex: Regex, replacement: String): String

Returns a new string obtained by replacing each substring of this char sequence that matches the given regular expression with the given replacement.

inline fun CharSequence.replace(regex: Regex, noinline transform: (MatchResult) -> CharSequence): String
inline fun CharSequence.replace(regex: Regex, noinline transform: (MatchResult) -> CharSequence): String
inline fun CharSequence.replace(regex: Regex, noinline transform: (MatchResult) -> CharSequence): String

Returns a new string obtained by replacing each substring of this char sequence that matches the given regular expression with the result of the given function transform that takes MatchResult and returns a string to be used as a replacement for that match.

actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String

Returns a new string with all occurrences of oldChar replaced with newChar.

actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String

Returns a new string obtained by replacing all occurrences of the oldValue substring in this string with the specified newValue string.

actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String

Returns a new string with all occurrences of oldChar replaced with newChar.

actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String

Returns a new string obtained by replacing all occurrences of the oldValue substring in this string with the specified newValue string.

actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean): String
actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean): String
actual fun String.replace(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean): String

Returns a new string with all occurrences of oldChar replaced with newChar.

actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean): String
actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean): String
actual fun String.replace(    oldValue: String,     newValue: String,     ignoreCase: Boolean): String

Returns a new string obtained by replacing all occurrences of the oldValue substring in this string with the specified newValue string.

Link copied to clipboard
fun String.replaceAfter(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfter(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfter(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfter(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfter(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfter(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String

Replace part of string after the first occurrence of given delimiter with the replacement string. If the string does not contain the delimiter, returns missingDelimiterValue which defaults to the original string.

Link copied to clipboard
fun String.replaceAfterLast(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfterLast(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfterLast(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfterLast(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfterLast(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceAfterLast(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String

Replace part of string after the last occurrence of given delimiter with the replacement string. If the string does not contain the delimiter, returns missingDelimiterValue which defaults to the original string.

Link copied to clipboard
fun String.replaceBefore(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBefore(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBefore(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBefore(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBefore(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBefore(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String

Replace part of string before the first occurrence of given delimiter with the replacement string. If the string does not contain the delimiter, returns missingDelimiterValue which defaults to the original string.

Link copied to clipboard
fun String.replaceBeforeLast(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBeforeLast(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBeforeLast(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBeforeLast(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBeforeLast(    delimiter: Char,     replacement: String,     missingDelimiterValue: String = this): String
fun String.replaceBeforeLast(    delimiter: String,     replacement: String,     missingDelimiterValue: String = this): String

Replace part of string before the last occurrence of given delimiter with the replacement string. If the string does not contain the delimiter, returns missingDelimiterValue which defaults to the original string.

Link copied to clipboard
expect fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
expect fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
expect fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String

Returns a new string with the first occurrence of oldChar replaced with newChar.

expect fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
expect fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
expect fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String

Returns a new string obtained by replacing the first occurrence of the oldValue substring in this string with the specified newValue string.

inline fun CharSequence.replaceFirst(regex: Regex, replacement: String): String
inline fun CharSequence.replaceFirst(regex: Regex, replacement: String): String
inline fun CharSequence.replaceFirst(regex: Regex, replacement: String): String

Replaces the first occurrence of the given regular expression regex in this char sequence with specified replacement expression.

actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String

Returns a new string with the first occurrence of oldChar replaced with newChar.

actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String

Returns a new string obtained by replacing the first occurrence of the oldValue substring in this string with the specified newValue string.

actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean = false): String
actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean): String
actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean): String
actual fun String.replaceFirst(    oldChar: Char,     newChar: Char,     ignoreCase: Boolean): String

Returns a new string with the first occurrence of oldChar replaced with newChar.

actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean): String
actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean): String
actual fun String.replaceFirst(    oldValue: String,     newValue: String,     ignoreCase: Boolean): String

Returns a new string obtained by replacing the first occurrence of the oldValue substring in this string with the specified newValue string.

Link copied to clipboard
@JvmName(name = "replaceFirstCharWithChar")
inline fun String.replaceFirstChar(transform: (Char) -> Char): String
@JvmName(name = "replaceFirstCharWithCharSequence")
inline fun String.replaceFirstChar(transform: (Char) -> CharSequence): String
@JvmName(name = "replaceFirstCharWithChar")
inline fun String.replaceFirstChar(transform: (Char) -> Char): String
@JvmName(name = "replaceFirstCharWithCharSequence")
inline fun String.replaceFirstChar(transform: (Char) -> CharSequence): String
@JvmName(name = "replaceFirstCharWithChar")
inline fun String.replaceFirstChar(transform: (Char) -> Char): String
@JvmName(name = "replaceFirstCharWithCharSequence")
inline fun String.replaceFirstChar(transform: (Char) -> CharSequence): String

Returns a copy of this string having its first character replaced with the result of the specified transform, or the original string if it's empty.

Link copied to clipboard
fun String.replaceIndent(newIndent: String = ""): String
fun String.replaceIndent(newIndent: String = ""): String
fun String.replaceIndent(newIndent: String = ""): String

Detects a common minimal indent like it does trimIndent and replaces it with the specified newIndent.

Link copied to clipboard
fun String.replaceIndentByMargin(newIndent: String = "", marginPrefix: String = "|"): String
fun String.replaceIndentByMargin(newIndent: String = "", marginPrefix: String = "|"): String
fun String.replaceIndentByMargin(newIndent: String = "", marginPrefix: String = "|"): String

Detects indent by marginPrefix as it does trimMargin and replace it with newIndent.

Link copied to clipboard
inline fun String.replaceRange(    startIndex: Int,     endIndex: Int,     replacement: CharSequence): String
inline fun String.replaceRange(    startIndex: Int,     endIndex: Int,     replacement: CharSequence): String
inline fun String.replaceRange(    startIndex: Int,     endIndex: Int,     replacement: CharSequence): String

Replaces the part of the string at the given range with the replacement char sequence.

inline fun String.replaceRange(range: IntRange, replacement: CharSequence): String
inline fun String.replaceRange(range: IntRange, replacement: CharSequence): String
inline fun String.replaceRange(range: IntRange, replacement: CharSequence): String

Replace the part of string at the given range with the replacement string.

fun CharSequence.replaceRange(    startIndex: Int,     endIndex: Int,     replacement: CharSequence): CharSequence
fun CharSequence.replaceRange(    startIndex: Int,     endIndex: Int,     replacement: CharSequence): CharSequence
fun CharSequence.replaceRange(    startIndex: Int,     endIndex: Int,     replacement: CharSequence): CharSequence

Returns a char sequence with content of this char sequence where its part at the given range is replaced with the replacement char sequence.

Returns a char sequence with content of this char sequence where its part at the given range is replaced with the replacement char sequence.

Link copied to clipboard
inline fun String.reversed(): String
inline fun String.reversed(): String
inline fun String.reversed(): String

Returns a string with characters in reversed order.

Returns a char sequence with characters in reversed order.

Link copied to clipboard
inline fun <R> CharSequence.runningFold(initial: R, operation: (acc: R, Char) -> R): List<R>
inline fun <R> CharSequence.runningFold(initial: R, operation: (acc: R, Char) -> R): List<R>
inline fun <R> CharSequence.runningFold(initial: R, operation: (acc: R, Char) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each character and current accumulator value that starts with initial value.

Link copied to clipboard
inline fun <R> CharSequence.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List<R>
inline fun <R> CharSequence.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List<R>
inline fun <R> CharSequence.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each character, its index in the original char sequence and current accumulator value that starts with initial value.

Link copied to clipboard
inline fun CharSequence.runningReduce(operation: (acc: Char, Char) -> Char): List<Char>
inline fun CharSequence.runningReduce(operation: (acc: Char, Char) -> Char): List<Char>
inline fun CharSequence.runningReduce(operation: (acc: Char, Char) -> Char): List<Char>

Returns a list containing successive accumulation values generated by applying operation from left to right to each character and current accumulator value that starts with the first character of this char sequence.

Link copied to clipboard
inline fun CharSequence.runningReduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): List<Char>
inline fun CharSequence.runningReduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): List<Char>
inline fun CharSequence.runningReduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): List<Char>

Returns a list containing successive accumulation values generated by applying operation from left to right to each character, its index in the original char sequence and current accumulator value that starts with the first character of this char sequence.

Link copied to clipboard
inline fun <R> CharSequence.scan(initial: R, operation: (acc: R, Char) -> R): List<R>
inline fun <R> CharSequence.scan(initial: R, operation: (acc: R, Char) -> R): List<R>
inline fun <R> CharSequence.scan(initial: R, operation: (acc: R, Char) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each character and current accumulator value that starts with initial value.

Link copied to clipboard
inline fun <R> CharSequence.scanIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List<R>
inline fun <R> CharSequence.scanIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List<R>
inline fun <R> CharSequence.scanIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each character, its index in the original char sequence and current accumulator value that starts with initial value.

Link copied to clipboard

Returns the single character, or throws an exception if the char sequence is empty or has more than one character.

inline fun CharSequence.single(predicate: (Char) -> Boolean): Char
inline fun CharSequence.single(predicate: (Char) -> Boolean): Char
inline fun CharSequence.single(predicate: (Char) -> Boolean): Char

Returns the single character matching the given predicate, or throws exception if there is no or more than one matching character.

Link copied to clipboard

Returns single character, or null if the char sequence is empty or has more than one character.

inline fun CharSequence.singleOrNull(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.singleOrNull(predicate: (Char) -> Boolean): Char?
inline fun CharSequence.singleOrNull(predicate: (Char) -> Boolean): Char?

Returns the single character matching the given predicate, or null if character was not found or more than one character was found.

Link copied to clipboard
fun String.slice(indices: IntRange): String
fun String.slice(indices: IntRange): String
fun String.slice(indices: IntRange): String

Returns a string containing characters of the original string at the specified range of indices.

inline fun String.slice(indices: Iterable<Int>): String
inline fun String.slice(indices: Iterable<Int>): String
inline fun String.slice(indices: Iterable<Int>): String

Returns a string containing characters of the original string at specified indices.

Returns a char sequence containing characters of the original char sequence at the specified range of indices.

Returns a char sequence containing characters of the original char sequence at specified indices.

Link copied to clipboard
fun CharSequence.split(    vararg delimiters: String,     ignoreCase: Boolean = false,     limit: Int = 0): List<String>
fun CharSequence.split(    vararg delimiters: Char,     ignoreCase: Boolean = false,     limit: Int = 0): List<String>
fun CharSequence.split(    vararg delimiters: String,     ignoreCase: Boolean = false,     limit: Int = 0): List<String>
fun CharSequence.split(    vararg delimiters: Char,     ignoreCase: Boolean = false,     limit: Int = 0): List<String>
fun CharSequence.split(    vararg delimiters: String,     ignoreCase: Boolean = false,     limit: Int = 0): List<String>
fun CharSequence.split(    vararg delimiters: Char,     ignoreCase: Boolean = false,     limit: Int = 0): List<String>

Splits this char sequence to a list of strings around occurrences of the specified delimiters.

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

Splits this char sequence around matches of the given regular expression.

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

Splits this char sequence around matches of the given regular expression.

Link copied to clipboard
fun CharSequence.splitToSequence(    vararg delimiters: String,     ignoreCase: Boolean = false,     limit: Int = 0): Sequence<String>
fun CharSequence.splitToSequence(    vararg delimiters: Char,     ignoreCase: Boolean = false,     limit: Int = 0): Sequence<String>
fun CharSequence.splitToSequence(    vararg delimiters: String,     ignoreCase: Boolean = false,     limit: Int = 0): Sequence<String>
fun CharSequence.splitToSequence(    vararg delimiters: Char,     ignoreCase: Boolean = false,     limit: Int = 0): Sequence<String>
fun CharSequence.splitToSequence(    vararg delimiters: String,     ignoreCase: Boolean = false,     limit: Int = 0): Sequence<String>
fun CharSequence.splitToSequence(    vararg delimiters: Char,     ignoreCase: Boolean = false,     limit: Int = 0): Sequence<String>

Splits this char sequence to a sequence of strings around occurrences of the specified delimiters.

Link copied to clipboard
expect fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean
expect fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
expect fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean
expect fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
expect fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean
expect fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
fun CharSequence.startsWith(char: Char, ignoreCase: Boolean = false): Boolean
fun CharSequence.startsWith(char: Char, ignoreCase: Boolean = false): Boolean
fun CharSequence.startsWith(char: Char, ignoreCase: Boolean = false): Boolean

Returns true if this char sequence starts with the specified character.

fun CharSequence.startsWith(prefix: CharSequence, ignoreCase: Boolean = false): Boolean
fun CharSequence.startsWith(prefix: CharSequence, ignoreCase: Boolean = false): Boolean
fun CharSequence.startsWith(prefix: CharSequence, ignoreCase: Boolean = false): Boolean

Returns true if this char sequence starts with the specified prefix.

fun CharSequence.startsWith(    prefix: CharSequence,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
fun CharSequence.startsWith(    prefix: CharSequence,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
fun CharSequence.startsWith(    prefix: CharSequence,     startIndex: Int,     ignoreCase: Boolean = false): Boolean

Returns true if a substring of this char sequence starting at the specified offset startIndex starts with the specified prefix.

actual fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean
actual fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean
actual fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean

Returns true if this string starts with the specified prefix.

actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean

Returns true if a substring of this string starting at the specified offset startIndex starts with the specified prefix.

actual fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean
actual fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean
actual fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean

Returns true if this string starts with the specified prefix.

actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean
actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean = false): Boolean

Returns true if a substring of this string starting at the specified offset startIndex starts with the specified prefix.

actual fun String.startsWith(prefix: String, ignoreCase: Boolean): Boolean
actual fun String.startsWith(prefix: String, ignoreCase: Boolean): Boolean
actual fun String.startsWith(prefix: String, ignoreCase: Boolean): Boolean

Returns true if this string starts with the specified prefix.

actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean): Boolean
actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean): Boolean
actual fun String.startsWith(    prefix: String,     startIndex: Int,     ignoreCase: Boolean): Boolean

Returns true if a substring of this string starting at the specified offset startIndex starts with the specified prefix.

Link copied to clipboard
inline fun String.subSequence(start: Int, end: Int): CharSequence
inline fun String.subSequence(start: Int, end: Int): CharSequence
inline fun String.subSequence(start: Int, end: Int): CharSequence

Returns a subsequence of this char sequence.

Returns a subsequence of this char sequence specified by the given range of indices.

Link copied to clipboard

Returns a substring specified by the given range of indices.

expect fun String.substring(startIndex: Int): String
expect fun String.substring(startIndex: Int, endIndex: Int): String
expect fun String.substring(startIndex: Int): String
expect fun String.substring(startIndex: Int, endIndex: Int): String
expect fun String.substring(startIndex: Int): String
expect fun String.substring(startIndex: Int, endIndex: Int): String
inline fun CharSequence.substring(startIndex: Int, endIndex: Int = length): String
inline fun CharSequence.substring(startIndex: Int, endIndex: Int = length): String
inline fun CharSequence.substring(startIndex: Int, endIndex: Int = length): String

Returns a substring of chars from a range of this char sequence starting at the startIndex and ending right before the endIndex.

Returns a substring of chars at indices from the specified range of this char sequence.

actual inline fun String.substring(startIndex: Int): String
actual inline fun String.substring(startIndex: Int): String
actual inline fun String.substring(startIndex: Int): String

Returns a substring of this string that starts at the specified startIndex and continues to the end of the string.

actual inline fun String.substring(startIndex: Int, endIndex: Int): String
actual inline fun String.substring(startIndex: Int, endIndex: Int): String
actual inline fun String.substring(startIndex: Int, endIndex: Int): String

Returns the substring of this string starting at the startIndex and ending right before the endIndex.

actual inline fun String.substring(startIndex: Int): String
actual inline fun String.substring(startIndex: Int, endIndex: Int): String
actual inline fun String.substring(startIndex: Int): String
actual inline fun String.substring(startIndex: Int, endIndex: Int): String
actual inline fun String.substring(startIndex: Int): String
actual inline fun String.substring(startIndex: Int, endIndex: Int): String
actual inline fun String.substring(startIndex: Int): String
actual inline fun String.substring(startIndex: Int): String
actual inline fun String.substring(startIndex: Int): String

Returns a substring of this string that starts at the specified startIndex and continues to the end of the string.

actual inline fun String.substring(startIndex: Int, endIndex: Int): String
actual inline fun String.substring(startIndex: Int, endIndex: Int): String
actual inline fun String.substring(startIndex: Int, endIndex: Int): String

Returns the substring of this string starting at the startIndex and ending right before the endIndex.

Link copied to clipboard
fun String.substringAfter(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringAfter(delimiter: String, missingDelimiterValue: String = this): String
fun String.substringAfter(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringAfter(delimiter: String, missingDelimiterValue: String = this): String
fun String.substringAfter(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringAfter(delimiter: String, missingDelimiterValue: String = this): String

Returns a substring after the first occurrence of delimiter. If the string does not contain the delimiter, returns missingDelimiterValue which defaults to the original string.

Link copied to clipboard
fun String.substringAfterLast(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringAfterLast(delimiter: String, missingDelimiterValue: String = this): String
fun String.substringAfterLast(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringAfterLast(delimiter: String, missingDelimiterValue: String = this): String
fun String.substringAfterLast(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringAfterLast(delimiter: String, missingDelimiterValue: String = this): String

Returns a substring after the last occurrence of delimiter. If the string does not contain the delimiter, returns missingDelimiterValue which defaults to the original string.

Link copied to clipboard
fun String.substringBefore(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringBefore(delimiter: String, missingDelimiterValue: String = this): String
fun String.substringBefore(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringBefore(delimiter: String, missingDelimiterValue: String = this): String
fun String.substringBefore(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringBefore(delimiter: String, missingDelimiterValue: String = this): String

Returns a substring before the first occurrence of delimiter. If the string does not contain the delimiter, returns missingDelimiterValue which defaults to the original string.

Link copied to clipboard
fun String.substringBeforeLast(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringBeforeLast(delimiter: String, missingDelimiterValue: String = this): String
fun String.substringBeforeLast(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringBeforeLast(delimiter: String, missingDelimiterValue: String = this): String
fun String.substringBeforeLast(delimiter: Char, missingDelimiterValue: String = this): String
fun String.substringBeforeLast(delimiter: String, missingDelimiterValue: String = this): String

Returns a substring before the last occurrence of delimiter. If the string does not contain the delimiter, returns missingDelimiterValue which defaults to the original string.

Link copied to clipboard
inline fun CharSequence.sumBy(selector: (Char) -> Int): Int
inline fun CharSequence.sumBy(selector: (Char) -> Int): Int
inline fun CharSequence.sumBy(selector: (Char) -> Int): Int

Returns the sum of all values produced by selector function applied to each character in the char sequence.

Link copied to clipboard
inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double
inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double
inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double

Returns the sum of all values produced by selector function applied to each character in the char sequence.

Link copied to clipboard
@JvmName(name = "sumOfDouble")
inline fun CharSequence.sumOf(selector: (Char) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun CharSequence.sumOf(selector: (Char) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun CharSequence.sumOf(selector: (Char) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun CharSequence.sumOf(selector: (Char) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun CharSequence.sumOf(selector: (Char) -> ULong): ULong
@JvmName(name = "sumOfDouble")
inline fun CharSequence.sumOf(selector: (Char) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun CharSequence.sumOf(selector: (Char) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun CharSequence.sumOf(selector: (Char) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun CharSequence.sumOf(selector: (Char) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun CharSequence.sumOf(selector: (Char) -> ULong): ULong
@JvmName(name = "sumOfDouble")
inline fun CharSequence.sumOf(selector: (Char) -> Double): Double
@JvmName(name = "sumOfInt")
inline fun CharSequence.sumOf(selector: (Char) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun CharSequence.sumOf(selector: (Char) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun CharSequence.sumOf(selector: (Char) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun CharSequence.sumOf(selector: (Char) -> ULong): ULong

Returns the sum of all values produced by selector function applied to each character in the char sequence.

@JvmName(name = "sumOfBigDecimal")
inline fun CharSequence.sumOf(selector: (Char) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun CharSequence.sumOf(selector: (Char) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun CharSequence.sumOf(selector: (Char) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun CharSequence.sumOf(selector: (Char) -> BigInteger): BigInteger
@JvmName(name = "sumOfBigDecimal")
inline fun CharSequence.sumOf(selector: (Char) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
inline fun CharSequence.sumOf(selector: (Char) -> BigInteger): BigInteger

Returns the sum of all values produced by selector function applied to each character in the char sequence.

Link copied to clipboard

Returns a string containing the first n characters from this string, or the entire string if this string is shorter.

Returns a subsequence of this char sequence containing the first n characters from this char sequence, or the entire char sequence if this char sequence is shorter.

Link copied to clipboard

Returns a string containing the last n characters from this string, or the entire string if this string is shorter.

Returns a subsequence of this char sequence containing the last n characters from this char sequence, or the entire char sequence if this char sequence is shorter.

Link copied to clipboard
inline fun String.takeLastWhile(predicate: (Char) -> Boolean): String
inline fun String.takeLastWhile(predicate: (Char) -> Boolean): String
inline fun String.takeLastWhile(predicate: (Char) -> Boolean): String

Returns a string containing last characters that satisfy the given predicate.

inline fun CharSequence.takeLastWhile(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.takeLastWhile(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.takeLastWhile(predicate: (Char) -> Boolean): CharSequence

Returns a subsequence of this char sequence containing last characters that satisfy the given predicate.

Link copied to clipboard
inline fun String.takeWhile(predicate: (Char) -> Boolean): String
inline fun String.takeWhile(predicate: (Char) -> Boolean): String
inline fun String.takeWhile(predicate: (Char) -> Boolean): String

Returns a string containing the first characters that satisfy the given predicate.

inline fun CharSequence.takeWhile(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.takeWhile(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.takeWhile(predicate: (Char) -> Boolean): CharSequence

Returns a subsequence of this char sequence containing the first characters that satisfy the given predicate.

Link copied to clipboard
inline fun String.toBigDecimal(mathContext: MathContext): BigDecimal
inline fun String.toBigDecimal(mathContext: MathContext): BigDecimal
inline fun String.toBigDecimal(mathContext: MathContext): BigDecimal

Parses the string as a java.math.BigDecimal number and returns the result.

Link copied to clipboard

Parses the string as a java.math.BigDecimal number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
inline fun String.toBigInteger(radix: Int): BigInteger
inline fun String.toBigInteger(radix: Int): BigInteger
inline fun String.toBigInteger(radix: Int): BigInteger

Parses the string as a java.math.BigInteger number and returns the result.

Link copied to clipboard

Parses the string as a java.math.BigInteger number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
expect fun String.toBoolean(): Boolean
expect fun String.toBoolean(): Boolean
expect fun String.toBoolean(): Boolean

Returns true if the content of this string is equal to the word "true", ignoring case, and false otherwise.

expect fun String?.toBoolean(): Boolean
expect fun String?.toBoolean(): Boolean
expect fun String?.toBoolean(): Boolean

Returns true if this string is not null and its content is equal to the word "true", ignoring case, and false otherwise.

actual inline fun String.toBoolean(): Boolean
actual inline fun String.toBoolean(): Boolean
actual inline fun String.toBoolean(): Boolean

Returns true if the content of this string is equal to the word "true", ignoring case, and false otherwise.

@JvmName(name = "toBooleanNullable")
actual inline fun String?.toBoolean(): Boolean
@JvmName(name = "toBooleanNullable")
actual inline fun String?.toBoolean(): Boolean
@JvmName(name = "toBooleanNullable")
actual inline fun String?.toBoolean(): Boolean

Returns true if this string is not null and its content is equal to the word "true", ignoring case, and false otherwise.

actual inline fun String.toBoolean(): Boolean
actual inline fun String.toBoolean(): Boolean
actual inline fun String.toBoolean(): Boolean

Returns true if the content of this string is equal to the word "true", ignoring case, and false otherwise.

actual fun String?.toBoolean(): Boolean
actual fun String?.toBoolean(): Boolean
actual fun String?.toBoolean(): Boolean

Returns true if this string is not null and its content is equal to the word "true", ignoring case, and false otherwise.

actual inline fun String.toBoolean(): Boolean
actual inline fun String.toBoolean(): Boolean
actual inline fun String.toBoolean(): Boolean

Returns true if the content of this string is equal to the word "true", ignoring case, and false otherwise.

actual inline fun String?.toBoolean(): Boolean
actual inline fun String?.toBoolean(): Boolean
actual inline fun String?.toBoolean(): Boolean

Returns true if this string is not null and its content is equal to the word "true", ignoring case, and false otherwise.

Link copied to clipboard

Returns true if the content of this string is equal to the word "true", false if it is equal to "false", and throws an exception otherwise.

Link copied to clipboard

Returns true if the content of this string is equal to the word "true", false if it is equal to "false", and null otherwise.

Link copied to clipboard
expect fun String.toByte(): Byte
expect fun String.toByte(radix: Int): Byte
expect fun String.toByte(): Byte
expect fun String.toByte(radix: Int): Byte
expect fun String.toByte(): Byte
expect fun String.toByte(radix: Int): Byte

Parses the string as a signed Byte number and returns the result.

actual inline fun String.toByte(): Byte
actual inline fun String.toByte(radix: Int): Byte
actual inline fun String.toByte(): Byte
actual inline fun String.toByte(radix: Int): Byte
actual inline fun String.toByte(): Byte
actual inline fun String.toByte(radix: Int): Byte

Parses the string as a signed Byte number and returns the result.

actual fun String.toByte(): Byte
actual fun String.toByte(radix: Int): Byte
actual fun String.toByte(): Byte
actual fun String.toByte(radix: Int): Byte
actual fun String.toByte(): Byte
actual fun String.toByte(radix: Int): Byte

Parses the string as a signed Byte number and returns the result.

actual inline fun String.toByte(): Byte
actual inline fun String.toByte(radix: Int): Byte
actual inline fun String.toByte(): Byte
actual inline fun String.toByte(radix: Int): Byte
actual inline fun String.toByte(): Byte
actual inline fun String.toByte(radix: Int): Byte

Parses the string as a signed Byte number and returns the result.

Link copied to clipboard
inline fun String.toByteArray(charset: Charset = Charsets.UTF_8): ByteArray
inline fun String.toByteArray(charset: Charset = Charsets.UTF_8): ByteArray
inline fun String.toByteArray(charset: Charset = Charsets.UTF_8): ByteArray

Encodes the contents of this string using the specified character set and returns the resulting byte array.

Link copied to clipboard
fun String.toByteOrNull(radix: Int): Byte?
fun String.toByteOrNull(radix: Int): Byte?
fun String.toByteOrNull(radix: Int): Byte?

Parses the string as a signed Byte number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard

Returns a CharArray containing characters of this string.

expect fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray
expect fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray
expect fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray

Returns a CharArray containing characters of this string or its substring.

inline fun String.toCharArray(    destination: CharArray,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = length): CharArray
inline fun String.toCharArray(    destination: CharArray,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = length): CharArray
inline fun String.toCharArray(    destination: CharArray,     destinationOffset: Int = 0,     startIndex: Int = 0,     endIndex: Int = length): CharArray

Copies characters from this string into the destination character array and returns that array.

actual inline fun String.toCharArray(): CharArray
actual inline fun String.toCharArray(): CharArray
actual inline fun String.toCharArray(): CharArray

Returns a CharArray containing characters of this string.

actual fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray
actual fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray
actual fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray

Returns a CharArray containing characters of this string or its substring.

Returns a CharArray containing characters of this string.

actual fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray
actual fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray
actual fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray

Returns a CharArray containing characters of this string or its substring.

Returns a CharArray containing characters of this string.

actual fun String.toCharArray(startIndex: Int, endIndex: Int): CharArray
actual fun String.toCharArray(startIndex: Int, endIndex: Int): CharArray
actual fun String.toCharArray(startIndex: Int, endIndex: Int): CharArray

Returns a CharArray containing characters of this string or its substring.

Link copied to clipboard
fun <C : MutableCollection<in Char>> CharSequence.toCollection(destination: C): C
fun <C : MutableCollection<in Char>> CharSequence.toCollection(destination: C): C
fun <C : MutableCollection<in Char>> CharSequence.toCollection(destination: C): C

Appends all characters to the given destination collection.

Link copied to clipboard
expect fun String.toDouble(): Double
expect fun String.toDouble(): Double
expect fun String.toDouble(): Double

Parses the string as a Double number and returns the result.

actual inline fun String.toDouble(): Double
actual inline fun String.toDouble(): Double
actual inline fun String.toDouble(): Double

Parses the string as a Double number and returns the result.

actual fun String.toDouble(): Double
actual fun String.toDouble(): Double
actual fun String.toDouble(): Double

Parses the string as a Double number and returns the result.

actual inline fun String.toDouble(): Double
actual inline fun String.toDouble(): Double
actual inline fun String.toDouble(): Double

Parses the string as a Double number and returns the result.

Link copied to clipboard

Parses the string as a Double number and returns the result or null if the string is not a valid representation of a number.

Parses the string as a Double number and returns the result or null if the string is not a valid representation of a number.

Parses the string as a Double number and returns the result or null if the string is not a valid representation of a number.

Parses the string as a Double number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
expect fun String.toFloat(): Float
expect fun String.toFloat(): Float
expect fun String.toFloat(): Float

Parses the string as a Float number and returns the result.

actual inline fun String.toFloat(): Float
actual inline fun String.toFloat(): Float
actual inline fun String.toFloat(): Float

Parses the string as a Float number and returns the result.

actual inline fun String.toFloat(): Float
actual inline fun String.toFloat(): Float
actual inline fun String.toFloat(): Float

Parses the string as a Float number and returns the result.

actual inline fun String.toFloat(): Float
actual inline fun String.toFloat(): Float
actual inline fun String.toFloat(): Float

Parses the string as a Float number and returns the result.

Link copied to clipboard
expect fun String.toFloatOrNull(): Float?
expect fun String.toFloatOrNull(): Float?
expect fun String.toFloatOrNull(): Float?

Parses the string as a Float number and returns the result or null if the string is not a valid representation of a number.

actual fun String.toFloatOrNull(): Float?
actual fun String.toFloatOrNull(): Float?
actual fun String.toFloatOrNull(): Float?

Parses the string as a Float number and returns the result or null if the string is not a valid representation of a number.

actual inline fun String.toFloatOrNull(): Float?
actual inline fun String.toFloatOrNull(): Float?
actual inline fun String.toFloatOrNull(): Float?

Parses the string as a Float number and returns the result or null if the string is not a valid representation of a number.

actual fun String.toFloatOrNull(): Float?
actual fun String.toFloatOrNull(): Float?
actual fun String.toFloatOrNull(): Float?

Parses the string as a Float number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
Link copied to clipboard
expect fun String.toInt(): Int
expect fun String.toInt(radix: Int): Int
expect fun String.toInt(): Int
expect fun String.toInt(radix: Int): Int
expect fun String.toInt(): Int
expect fun String.toInt(radix: Int): Int

Parses the string as an Int number and returns the result.

actual inline fun String.toInt(): Int
actual inline fun String.toInt(radix: Int): Int
actual inline fun String.toInt(): Int
actual inline fun String.toInt(radix: Int): Int
actual inline fun String.toInt(): Int
actual inline fun String.toInt(radix: Int): Int

Parses the string as an Int number and returns the result.

actual fun String.toInt(): Int
actual fun String.toInt(radix: Int): Int
actual fun String.toInt(): Int
actual fun String.toInt(radix: Int): Int
actual fun String.toInt(): Int
actual fun String.toInt(radix: Int): Int

Parses the string as an Int number and returns the result.

actual inline fun String.toInt(): Int
actual inline fun String.toInt(radix: Int): Int
actual inline fun String.toInt(): Int
actual inline fun String.toInt(radix: Int): Int
actual inline fun String.toInt(): Int
actual inline fun String.toInt(radix: Int): Int

Parses the string as an Int number and returns the result.

Link copied to clipboard
fun String.toIntOrNull(radix: Int): Int?
fun String.toIntOrNull(radix: Int): Int?
fun String.toIntOrNull(radix: Int): Int?

Parses the string as an Int number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard

Returns a List containing all characters.

Link copied to clipboard
expect fun String.toLong(): Long
expect fun String.toLong(radix: Int): Long
expect fun String.toLong(): Long
expect fun String.toLong(radix: Int): Long
expect fun String.toLong(): Long
expect fun String.toLong(radix: Int): Long

Parses the string as a Long number and returns the result.

actual inline fun String.toLong(): Long
actual inline fun String.toLong(radix: Int): Long
actual inline fun String.toLong(): Long
actual inline fun String.toLong(radix: Int): Long
actual inline fun String.toLong(): Long
actual inline fun String.toLong(radix: Int): Long

Parses the string as a Long number and returns the result.

actual fun String.toLong(): Long
actual fun String.toLong(radix: Int): Long
actual fun String.toLong(): Long
actual fun String.toLong(radix: Int): Long
actual fun String.toLong(): Long
actual fun String.toLong(radix: Int): Long

Parses the string as a Long number and returns the result.

actual inline fun String.toLong(): Long
actual inline fun String.toLong(radix: Int): Long
actual inline fun String.toLong(): Long
actual inline fun String.toLong(radix: Int): Long
actual inline fun String.toLong(): Long
actual inline fun String.toLong(radix: Int): Long

Parses the string as a Long number and returns the result.

Link copied to clipboard
fun String.toLongOrNull(radix: Int): Long?
fun String.toLongOrNull(radix: Int): Long?
fun String.toLongOrNull(radix: Int): Long?

Parses the string as a Long number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
expect fun String.toLowerCase(): String
expect fun String.toLowerCase(): String
expect fun String.toLowerCase(): String

Returns a copy of this string converted to lower case using the rules of the default locale.

inline fun String.toLowerCase(locale: Locale): String
inline fun String.toLowerCase(locale: Locale): String
inline fun String.toLowerCase(locale: Locale): String

Returns a copy of this string converted to lower case using the rules of the specified locale.

actual inline fun String.toLowerCase(): String
actual inline fun String.toLowerCase(): String
actual inline fun String.toLowerCase(): String

Returns a copy of this string converted to lower case using the rules of the default locale.

actual inline fun String.toLowerCase(): String
actual inline fun String.toLowerCase(): String
actual inline fun String.toLowerCase(): String

Returns a copy of this string converted to lower case using the rules of the default locale.

actual fun String.toLowerCase(): String
actual fun String.toLowerCase(): String
actual fun String.toLowerCase(): String

Returns a copy of this string converted to lower case using the rules of the default locale.

Link copied to clipboard

Returns a new MutableList filled with all characters of this char sequence.

Link copied to clipboard
inline fun String.toPattern(flags: Int = 0): Pattern
inline fun String.toPattern(flags: Int = 0): Pattern
inline fun String.toPattern(flags: Int = 0): Pattern

Converts the string into a regular expression Pattern optionally with the specified flags from Pattern or'd together so that strings can be split or matched on.

Link copied to clipboard
inline fun String.toRegex(): Regex
inline fun String.toRegex(): Regex
inline fun String.toRegex(): Regex

Converts the string into a regular expression Regex with the default options.

inline fun String.toRegex(option: RegexOption): Regex
inline fun String.toRegex(option: RegexOption): Regex
inline fun String.toRegex(option: RegexOption): Regex

Converts the string into a regular expression Regex with the specified single option.

inline fun String.toRegex(options: Set<RegexOption>): Regex
inline fun String.toRegex(options: Set<RegexOption>): Regex
inline fun String.toRegex(options: Set<RegexOption>): Regex

Converts the string into a regular expression Regex with the specified set of options.

Link copied to clipboard

Returns a Set of all characters.

Link copied to clipboard
expect fun String.toShort(): Short
expect fun String.toShort(radix: Int): Short
expect fun String.toShort(): Short
expect fun String.toShort(radix: Int): Short
expect fun String.toShort(): Short
expect fun String.toShort(radix: Int): Short

Parses the string as a Short number and returns the result.

actual inline fun String.toShort(): Short
actual inline fun String.toShort(radix: Int): Short
actual inline fun String.toShort(): Short
actual inline fun String.toShort(radix: Int): Short
actual inline fun String.toShort(): Short
actual inline fun String.toShort(radix: Int): Short

Parses the string as a Short number and returns the result.

actual fun String.toShort(): Short
actual fun String.toShort(radix: Int): Short
actual fun String.toShort(): Short
actual fun String.toShort(radix: Int): Short
actual fun String.toShort(): Short
actual fun String.toShort(radix: Int): Short

Parses the string as a Short number and returns the result.

actual inline fun String.toShort(): Short
actual inline fun String.toShort(radix: Int): Short
actual inline fun String.toShort(): Short
actual inline fun String.toShort(radix: Int): Short
actual inline fun String.toShort(): Short
actual inline fun String.toShort(radix: Int): Short

Parses the string as a Short number and returns the result.

Link copied to clipboard

Parses the string as a Short number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
Link copied to clipboard
fun String.toUByte(radix: Int): UByte
fun String.toUByte(radix: Int): UByte
fun String.toUByte(radix: Int): UByte

Parses the string as a signed UByte number and returns the result.

Link copied to clipboard

Parses the string as an UByte number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
fun String.toUInt(radix: Int): UInt
fun String.toUInt(radix: Int): UInt
fun String.toUInt(radix: Int): UInt

Parses the string as an UInt number and returns the result.

Link copied to clipboard
fun String.toUIntOrNull(radix: Int): UInt?
fun String.toUIntOrNull(radix: Int): UInt?
fun String.toUIntOrNull(radix: Int): UInt?

Parses the string as an UInt number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
fun String.toULong(radix: Int): ULong
fun String.toULong(radix: Int): ULong
fun String.toULong(radix: Int): ULong

Parses the string as a ULong number and returns the result.

Link copied to clipboard

Parses the string as an ULong number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
expect fun String.toUpperCase(): String
expect fun String.toUpperCase(): String
expect fun String.toUpperCase(): String

Returns a copy of this string converted to upper case using the rules of the default locale.

inline fun String.toUpperCase(locale: Locale): String
inline fun String.toUpperCase(locale: Locale): String
inline fun String.toUpperCase(locale: Locale): String

Returns a copy of this string converted to upper case using the rules of the specified locale.

actual inline fun String.toUpperCase(): String
actual inline fun String.toUpperCase(): String
actual inline fun String.toUpperCase(): String

Returns a copy of this string converted to upper case using the rules of the default locale.

actual inline fun String.toUpperCase(): String
actual inline fun String.toUpperCase(): String
actual inline fun String.toUpperCase(): String

Returns a copy of this string converted to upper case using the rules of the default locale.

actual fun String.toUpperCase(): String
actual fun String.toUpperCase(): String
actual fun String.toUpperCase(): String

Returns a copy of this string converted to upper case using the rules of the default locale.

Link copied to clipboard
fun String.toUShort(radix: Int): UShort
fun String.toUShort(radix: Int): UShort
fun String.toUShort(radix: Int): UShort

Parses the string as a UShort number and returns the result.

Link copied to clipboard

Parses the string as an UShort number and returns the result or null if the string is not a valid representation of a number.

Link copied to clipboard
inline fun String.trim(predicate: (Char) -> Boolean): String
inline fun String.trim(predicate: (Char) -> Boolean): String
inline fun String.trim(predicate: (Char) -> Boolean): String

Returns a string having leading and trailing characters matching the predicate removed.

fun String.trim(vararg chars: Char): String
fun String.trim(vararg chars: Char): String
fun String.trim(vararg chars: Char): String

Returns a string having leading and trailing characters from the chars array removed.

inline fun String.trim(): String
inline fun String.trim(): String
inline fun String.trim(): String

Returns a string having leading and trailing whitespace removed.

inline fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence

Returns a sub sequence of this char sequence having leading and trailing characters matching the predicate removed.

fun CharSequence.trim(vararg chars: Char): CharSequence
fun CharSequence.trim(vararg chars: Char): CharSequence
fun CharSequence.trim(vararg chars: Char): CharSequence

Returns a sub sequence of this char sequence having leading and trailing characters from the chars array removed.

Returns a sub sequence of this char sequence having leading and trailing whitespace removed.

Link copied to clipboard
inline fun String.trimEnd(predicate: (Char) -> Boolean): String
inline fun String.trimEnd(predicate: (Char) -> Boolean): String
inline fun String.trimEnd(predicate: (Char) -> Boolean): String

Returns a string having trailing characters matching the predicate removed.

fun String.trimEnd(vararg chars: Char): String
fun String.trimEnd(vararg chars: Char): String
fun String.trimEnd(vararg chars: Char): String

Returns a string having trailing characters from the chars array removed.

inline fun String.trimEnd(): String
inline fun String.trimEnd(): String
inline fun String.trimEnd(): String

Returns a string having trailing whitespace removed.

inline fun CharSequence.trimEnd(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.trimEnd(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.trimEnd(predicate: (Char) -> Boolean): CharSequence

Returns a sub sequence of this char sequence having trailing characters matching the predicate removed.

Returns a sub sequence of this char sequence having trailing characters from the chars array removed.

Returns a sub sequence of this char sequence having trailing whitespace removed.

Link copied to clipboard

Detects a common minimal indent of all the input lines, removes it from every line and also removes the first and the last lines if they are blank (notice difference blank vs empty).

Link copied to clipboard
fun String.trimMargin(marginPrefix: String = "|"): String
fun String.trimMargin(marginPrefix: String = "|"): String
fun String.trimMargin(marginPrefix: String = "|"): String

Trims leading whitespace characters followed by marginPrefix from every line of a source string and removes the first and the last lines if they are blank (notice difference blank vs empty).

Link copied to clipboard
inline fun String.trimStart(predicate: (Char) -> Boolean): String
inline fun String.trimStart(predicate: (Char) -> Boolean): String
inline fun String.trimStart(predicate: (Char) -> Boolean): String

Returns a string having leading characters matching the predicate removed.

fun String.trimStart(vararg chars: Char): String
fun String.trimStart(vararg chars: Char): String
fun String.trimStart(vararg chars: Char): String

Returns a string having leading characters from the chars array removed.

inline fun String.trimStart(): String
inline fun String.trimStart(): String
inline fun String.trimStart(): String

Returns a string having leading whitespace removed.

inline fun CharSequence.trimStart(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.trimStart(predicate: (Char) -> Boolean): CharSequence
inline fun CharSequence.trimStart(predicate: (Char) -> Boolean): CharSequence

Returns a sub sequence of this char sequence having leading characters matching the predicate removed.

Returns a sub sequence of this char sequence having leading characters from the chars array removed.

Returns a sub sequence of this char sequence having leading whitespace removed.

Link copied to clipboard
expect fun String.uppercase(): String
expect fun String.uppercase(): String
expect fun String.uppercase(): String

Returns a copy of this string converted to upper case using Unicode mapping rules of the invariant locale.

inline fun String.uppercase(locale: Locale): String
inline fun String.uppercase(locale: Locale): String
inline fun String.uppercase(locale: Locale): String

Returns a copy of this string converted to upper case using the rules of the specified locale.

actual inline fun String.uppercase(): String
actual inline fun String.uppercase(): String
actual inline fun String.uppercase(): String

Returns a copy of this string converted to upper case using Unicode mapping rules of the invariant locale.

actual inline fun String.uppercase(): String
actual inline fun String.uppercase(): String
actual inline fun String.uppercase(): String

Returns a copy of this string converted to upper case using Unicode mapping rules of the invariant locale.

actual fun String.uppercase(): String
actual fun String.uppercase(): String
actual fun String.uppercase(): String

Returns a copy of this string converted to upper case using Unicode mapping rules of the invariant locale.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun CharSequence.windowed(    size: Int,     step: Int = 1,     partialWindows: Boolean = false): List<String>
fun CharSequence.windowed(    size: Int,     step: Int = 1,     partialWindows: Boolean = false): List<String>
fun CharSequence.windowed(    size: Int,     step: Int = 1,     partialWindows: Boolean = false): List<String>

Returns a list of snapshots of the window of the given size sliding along this char sequence with the given step, where each snapshot is a string.

fun <R> CharSequence.windowed(    size: Int,     step: Int = 1,     partialWindows: Boolean = false,     transform: (CharSequence) -> R): List<R>
fun <R> CharSequence.windowed(    size: Int,     step: Int = 1,     partialWindows: Boolean = false,     transform: (CharSequence) -> R): List<R>
fun <R> CharSequence.windowed(    size: Int,     step: Int = 1,     partialWindows: Boolean = false,     transform: (CharSequence) -> R): List<R>

Returns a list of results of applying the given transform function to an each char sequence representing a view over the window of the given size sliding along this char sequence with the given step.

Link copied to clipboard
fun CharSequence.windowedSequence(    size: Int,     step: Int = 1,     partialWindows: Boolean = false): Sequence<String>
fun CharSequence.windowedSequence(    size: Int,     step: Int = 1,     partialWindows: Boolean = false): Sequence<String>
fun CharSequence.windowedSequence(    size: Int,     step: Int = 1,     partialWindows: Boolean = false): Sequence<String>

Returns a sequence of snapshots of the window of the given size sliding along this char sequence with the given step, where each snapshot is a string.

fun <R> CharSequence.windowedSequence(    size: Int,     step: Int = 1,     partialWindows: Boolean = false,     transform: (CharSequence) -> R): Sequence<R>
fun <R> CharSequence.windowedSequence(    size: Int,     step: Int = 1,     partialWindows: Boolean = false,     transform: (CharSequence) -> R): Sequence<R>
fun <R> CharSequence.windowedSequence(    size: Int,     step: Int = 1,     partialWindows: Boolean = false,     transform: (CharSequence) -> R): Sequence<R>

Returns a sequence of results of applying the given transform function to an each char sequence representing a view over the window of the given size sliding along this char sequence with the given step.

Link copied to clipboard

Returns a lazy Iterable that wraps each character of the original char sequence into an IndexedValue containing the index of that character and the character itself.

Link copied to clipboard

Returns a list of pairs built from the characters of this and the other char sequences with the same index The returned list has length of the shortest char sequence.

inline fun <V> CharSequence.zip(other: CharSequence, transform: (a: Char, b: Char) -> V): List<V>
inline fun <V> CharSequence.zip(other: CharSequence, transform: (a: Char, b: Char) -> V): List<V>
inline fun <V> CharSequence.zip(other: CharSequence, transform: (a: Char, b: Char) -> V): List<V>

Returns a list of values built from the characters of this and the other char sequences with the same index using the provided transform function applied to each pair of characters. The returned list has length of the shortest char sequence.

Link copied to clipboard

Returns a list of pairs of each two adjacent characters in this char sequence.

inline fun <R> CharSequence.zipWithNext(transform: (a: Char, b: Char) -> R): List<R>
inline fun <R> CharSequence.zipWithNext(transform: (a: Char, b: Char) -> R): List<R>
inline fun <R> CharSequence.zipWithNext(transform: (a: Char, b: Char) -> R): List<R>

Returns a list containing the results of applying the given transform function to an each pair of two adjacent characters in this char sequence.