firstNotNullOf

inline fun <R : Any> CharSequence.firstNotNullOf(transform: (Char) -> R?): R(source)

Returns the first non-null value produced by transform function being applied to characters of this char sequence in iteration order, or throws NoSuchElementException if no non-null value was produced.

Since Kotlin

1.5

Samples