dropWhile

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

inline fun CharSequence.dropWhile(predicate: (Char) -> Boolean): CharSequence(source)
fun main() {
    val text = "   Kotlin"
    val trimmed = text.dropWhile { it == ' ' }
    println(trimmed) // Output: Kotlin
}

Source