consumeWhile

fun consumeWhile(predicate: (Char) -> Boolean): String?

Iterate over the rest of the string as long as the predicate returns true, returning the result.