sublist method

view source

List<E> sublist (int start, [int? end]) inherited

Implementation

List<E> sublist(int start, [int? end]) {
  int listLength = this.length;
  end ??= listLength;
  if (end == null) throw "!"; // TODO(38493): The `??=` should promote.

  RangeError.checkValidRange(start, end, listLength);
  return List.from(getRange(start, end));
}