last

Common
JVM
JS
Native
1.0
fun CharSequence.last(): Char

Returns the last character.

Exceptions

NoSuchElementException - if the char sequence is empty.

Common
JVM
JS
Native
1.0
inline fun CharSequence.last(
    predicate: (Char) -> Boolean
): Char

Returns the last character matching the given predicate.

Exceptions

NoSuchElementException - if no such character is found.