count

fun <T> Sequence<T>.count(): Int(source)

Consumes all elements and returns their count, including null elements.

Throws

if the count exceeds Int.MAX_VALUE.


inline fun <T> Sequence<T>.count(predicate: (T) -> Boolean): Int(source)

Counts matches in iteration order, consuming the entire sequence. Exceptions propagate; the immediate inline callback admits non-local returns.

Throws

if the match count exceeds Int.MAX_VALUE.