ddash.range.drop

Drops elements from a range

Members

Functions

drop
auto drop(Range range, size_t n = 1)

Drops n elements from beginning of range

dropRight
auto dropRight(Range range, size_t n = 1)

Drops n elements from end of range

dropRightWhile
auto dropRightWhile(Range range)

Drops elements from end of range while predicate is true

dropWhile
auto dropWhile(Range range)

Drops elements from beginnig of range while predicate is true

Examples

assert([1, 2, 3, 4].drop.array == [2, 3, 4]);
assert([1, 2, 3, 4].dropRight.array == [1, 2, 3]);
assert([1, 2, 3, 4].dropWhile!(a => a < 3).array == [3, 4]);
assert([1, 2, 3, 4].dropRightWhile!(a => a > 2).equal([1, 2]));

Meta