lastOrNull

Returns the last character, or null if the char sequence is empty.

Since Kotlin

1.0

Samples


inline fun CharSequence.lastOrNull(predicate: (Char) -> Boolean): Char?(source)

Returns the last character matching the given predicate, or null if no such character was found.

Since Kotlin

1.0

Samples