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; });
| fn |
the predicate. |
|
a new Stream of leading matching elements. |