takeWhileInclusive

inline fun <E> Iterable<E>.takeWhileInclusive(predicate: (E) -> Boolean): List<E>(source)

Returns a list containing the elements from the receiver iterable up to and including the first element for which the given predicate returns false.

Receiver

The iterable to be processed.

Return

A list containing the elements from the receiver iterable up to and including the first element for which the predicate returns false.

Parameters

predicate

A function that determines if an element should be included in the output list.