strip

fnRange strip(Range, E)(Range range, E element) if (isBidirectionalRange!Range && is(typeof(range.front == element) : bool))

The strip group of functions allow stripping of either leading, trailing, or both leading and trailing elements.

The stripLeft function will strip the front of the range, the stripRight function will strip the back of the range, while the strip function will strip both the front and back of the range.

Note that the strip and stripRight functions require the range to be a BidirectionalRange range.

All of these functions come in two varieties: one takes a target element, where the range will be stripped as long as this element can be found. The other takes a lambda predicate, where the range will be stripped as long as the predicate returns true.

Parameters

rangea bidirectional range or input range
elementthe elements to remove

Returns

a Range with all of range except element at the start and end
fnRange strip(alias pred, Range)(Range range) if (isBidirectionalRange!Range && is(typeof(pred(range.back)) : bool))

ditto