trim

Common
JVM
JS
Native
1.0
inline fun CharSequence.trim(
    predicate: (Char) -> Boolean
): CharSequence

(source)

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

Common
JVM
JS
Native
1.0
inline fun String.trim(predicate: (Char) -> Boolean): String
(source)

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

Common
JVM
JS
Native
1.0
fun CharSequence.trim(vararg chars: Char): CharSequence
(source)

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

Common
JVM
JS
Native
1.0
fun String.trim(vararg chars: Char): String
(source)

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

Common
JVM
JS
Native
1.0

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

Common
JVM
JS
Native
1.0
fun String.trim(): String
(source)

Returns a string having leading and trailing whitespace removed.