first

open fun first(): T

Get the first element or throw an exception if there is no such element.

Return

T the first element

Throws

if sequence is empty.


open fun first(condition: T.() -> Boolean): T

Get the first element by condition or throw an exception if there is no such element.

Return

T the first element

Parameters

condition

filter condition

Throws

if sequence is empty.