takeWhile


Description:

public Stream<T> takeWhile (owned PredicateFunc<T> fn)

Returns a Stream of elements taken while the predicate is true. Stops at the first element that does not match.

Example:

    var taken = stream.takeWhile ((x) => { return x < 5; });

Parameters:

fn

the predicate.

Returns:

a new Stream of leading matching elements.