Removes the objects in the range start
inclusive to end
exclusive.
The provide range, given by start
and end
, must be valid.
A range from start
to end
is valid if 0 <= start <= end <= len
, where
len
is this list's length
. The range starts at start
and has length
end - start
. An empty range (with end == start
) is valid.
Throws an UnsupportedError
if this is a fixed-length list. In that case
the list is not modified.
Source
void removeRange(int start, int end) { RangeError.checkValidRange(start, end, this.length); int length = end - start; setRange(start, this.length - length, this, end); this.length -= length; }