slice

Returns a slice of range from start up to, but not including, end

If end is not provided the whole rest of the range is implied. And if end is a negative number then it's translated to range.length - abs(end).`

  1. auto slice(Range range, size_t start, int end)
  2. auto slice(Range range, size_t start)
    slice
    (
    Range
    )
    (
    Range range
    ,
    size_t start
    )

Parameters

range
Type: Range

the input range to slice

start
Type: size_t

at which index to start the slice

Return Value

Type: auto

A range

Examples

assert((int[]).init.tail.empty);
assert([1, 2, 3, 4].tail.equal([2, 3, 4]));
assert((int[]).init.initial.empty);
assert([1, 2, 3, 4].initial.equal([1, 2, 3]));

Meta

Since

0.0.1