first

fun <T> Iterable<T>.first(): T(source)

Returns the first element, throwing NoSuchElementException when empty.


inline fun <T> Iterable<T>.first(predicate: (T) -> Boolean): T(source)

Returns the first matching element, throwing NoSuchElementException when no element matches.