takeIf

fun takeIf(predicate: (Char) -> Boolean): Boolean

Return

whether the next character satisfied predicate and has been consumed