removeRange method
override
Removes a range of elements from the list.
Removes the elements with positions greater than or equal to start
and less than end
, from the list. This reduces the list's length by end - start
.
The provided range, given by start
and end
, must be valid. A range from start
to end
is valid if 0 ≤ start
≤ end
≤ length. An empty range (with end == start
) is valid.
The list must be growable.
Implementation
void removeRange(int start, int end) { RangeError.checkValidRange(start, end, this.length); if (end > start) { _closeGap(start, end); } }
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-collection/ListMixin/removeRange.html