takeWhile

fun <T> Sequence<T>.takeWhile(predicate: (T) -> Boolean): Sequence<T>(source)

Returns a sequence containing first elements satisfying the given predicate.

The operation is intermediate and stateless.

Since Kotlin

1.0

Samples