kotlin.sequences.first

first

fun <T> Sequence<T>.first(): T

Returns first element.

Exceptions

NoSuchElementException - if the sequence is empty.

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

Returns the first element matching the given predicate.

登录查看完整内容