until

fnUntil!(pred, Range, Sentinel) until(alias pred = "a == b", Range, Sentinel)(Range range, Sentinel sentinel, OpenRight openRight = Yes.openRight) if (!is(Sentinel == OpenRight))

Lazily iterates range _until the element e for which pred(e, sentinel) is true.

This is similar to takeWhile in other languages.

Parameters

predPredicate to determine when to stop.
rangeThe input range to iterate over.
sentinelThe element to stop at.
openRightDetermines whether the element for which the given predicate is true should be included in the resulting range (No.openRight), or not (Yes.openRight).

Returns

An input range that

iterates over the original range's elements, but ends when the specified predicate becomes true. If the original range is a

forward range or

higher, this range will be a forward range.

fnUntil!(pred, Range, void) until(alias pred, Range)(Range range, OpenRight openRight = Yes.openRight)

Ditto