splitOff method

Vec<T> splitOff(
  1. int at
)

Splits the collection into two at the given index. Returns a newly allocated vector containing the elements in the range [at, len). After the call, the original vector will be left containing the elements [0, at).

Implementation

Vec<T> splitOff(int at) {
  final split = sublist(at);
  removeRange(at, length);
  return split;
}