W3cubDocs

/Kotlin

trim

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
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.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
inline fun String.trim(predicate: (Char) -> Boolean): String

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

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
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.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun String.trim(vararg chars: Char): String

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

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun CharSequence.trim(): CharSequence

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

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun String.trim(): String

Returns a string having leading and trailing whitespace removed.

© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/trim.html