splitSlice method

(Slice<T>, Slice<T>) splitSlice(
  1. int index
)

Divides array into two Slices at index from start. The first will contain all indices from [0, M) (excluding the index M itself) and the second will contain all indices from [M, N) (excluding the index N itself).

Implementation

(Slice<T>, Slice<T>) splitSlice(int index) {
  assert(index >= 0 && index <= _list.length, "Index out of bounds");
  return (Slice(_list, 0, index), Slice(_list, index, _list.length));
}