Package-level declarations

Functions for working with text and regular expressions.

Functions for working with text and regular expressions.

Types

Link copied to clipboard
Since Kotlin 1.1
Link copied to clipboard

Represents the Unicode directionality of a character. Character directionality is used to calculate the visual ordering of text.

Since Kotlin 1.0
Link copied to clipboard
object Charsets

Constant definitions for the standard charsets. These charsets are guaranteed to be available on every implementation of the Java platform.

Since Kotlin 1.0
Link copied to clipboard
Since Kotlin 1.1

Functions

Link copied to clipboard

Appends a line separator to this Appendable.

Since Kotlin 1.0

Appends a line separator to this StringBuilder.

Since Kotlin 1.0
inline fun Appendable.appendln(value: Char): Appendable

Appends value to the given Appendable and line separator after it.

Since Kotlin 1.0

Appends value to this StringBuilder, followed by a line separator.

Since Kotlin 1.0
Link copied to clipboard
inline fun charset(charsetName: String): Charset

Returns a named charset with the given charsetName name.

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

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

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

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

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

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

Since Kotlin 1.0
Link copied to clipboard
inline fun String.concat(str: String): String
Since Kotlin 1.1
Link copied to clipboard
inline fun String.contentEquals(stringBuilder: StringBuffer): Boolean

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

Since Kotlin 1.0
inline fun String.contentEquals(charSequence: CharSequence): Boolean

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

Since Kotlin 1.0
Link copied to clipboard
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.

Since Kotlin 1.0
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.

Since Kotlin 1.0
inline fun String.Companion.format(format: String, vararg args: Any?): String

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

Since Kotlin 1.0
inline fun String.Companion.format(locale: Locale, format: String, vararg args: Any?): String

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

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

Returns a canonical representation for this string object.

Since Kotlin 1.0
Link copied to clipboard

Returns true if this character (Unicode code point) should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

Since Kotlin 1.0
Link copied to clipboard

Returns true if this character (Unicode code point) may be part of a Java identifier as other than the first character.

Since Kotlin 1.0
Link copied to clipboard

Returns true if this character is permissible as the first character in a Java identifier.

Since Kotlin 1.0
Link copied to clipboard
inline fun String.match(regex: String): Array<String>?
Since Kotlin 1.1
Link copied to clipboard
Since Kotlin 1.1
Link copied to clipboard
Since Kotlin 1.0
Link copied to clipboard
inline fun <R : Comparable<R>> CharSequence.maxBy(selector: (Char) -> R): Char?
Since Kotlin 1.0
Link copied to clipboard
fun CharSequence.maxWith(comparator: Comparator<in Char>): Char?
Since Kotlin 1.0
Link copied to clipboard
Since Kotlin 1.0
Link copied to clipboard
inline fun <R : Comparable<R>> CharSequence.minBy(selector: (Char) -> R): Char?
Since Kotlin 1.0
Link copied to clipboard
fun CharSequence.minWith(comparator: Comparator<in Char>): Char?
Since Kotlin 1.0
Link copied to clipboard
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.

Since Kotlin 1.0
Link copied to clipboard
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.

Since Kotlin 1.0
Link copied to clipboard
fun CharSequence.split(regex: Pattern, limit: Int = 0): List<String>

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

Since Kotlin 1.0
Link copied to clipboard
inline fun String(stringBuffer: StringBuffer): String

Converts the contents of the specified StringBuffer to a string.

Since Kotlin 1.0
inline fun String(stringBuilder: StringBuilder): String

Converts the contents of the specified StringBuilder to a string.

Since Kotlin 1.0
inline fun String(bytes: ByteArray): String

Converts the data from the specified array of bytes to characters using the UTF-8 character set and returns the conversion result as a string.

Since Kotlin 1.0
inline fun String(bytes: ByteArray, charset: Charset): String

Converts the data from the specified array of bytes to characters using the specified character set and returns the conversion result as a string.

Since Kotlin 1.0
inline fun String(bytes: ByteArray, offset: Int, length: Int): String

Converts the data from a portion of the specified array of bytes to characters using the UTF-8 character set and returns the conversion result as a string.

Since Kotlin 1.0
inline fun String(codePoints: IntArray, offset: Int, length: Int): String

Converts the code points from a portion of the specified Unicode code point array to a string.

Since Kotlin 1.0
inline fun String(bytes: ByteArray, offset: Int, length: Int, charset: Charset): String

Converts the data from a portion of the specified array of bytes to characters using the specified character set and returns the conversion result as a string.

Since Kotlin 1.0
Link copied to clipboard
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.

Since Kotlin 1.0
Link copied to clipboard
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.

Since Kotlin 1.0
Link copied to clipboard
inline fun String.toLowerCase(locale: Locale): String

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

Since Kotlin 1.0
Link copied to clipboard
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.

Since Kotlin 1.0
Link copied to clipboard
inline fun Pattern.toRegex(): Regex

Converts this java.util.regex.Pattern to an instance of Regex.

Since Kotlin 1.0
Link copied to clipboard

Returns a new SortedSet of all characters.

Since Kotlin 1.0
Link copied to clipboard
inline fun Char.toTitleCase(): Char

Converts this character to title case using Unicode mapping rules of the invariant locale.

Since Kotlin 1.0
Link copied to clipboard
inline fun String.toUpperCase(locale: Locale): String

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

Since Kotlin 1.0

Properties

Link copied to clipboard

Returns the Unicode directionality property for the given character.

Since Kotlin 1.0