Share via


AbstractList.RemoveRange(Int32, Int32) Method

Definition

Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.

[Android.Runtime.Register("removeRange", "(II)V", "GetRemoveRange_IIHandler")]
protected virtual void RemoveRange (int fromIndex, int toIndex);
[<Android.Runtime.Register("removeRange", "(II)V", "GetRemoveRange_IIHandler")>]
abstract member RemoveRange : int * int -> unit
override this.RemoveRange : int * int -> unit

Parameters

fromIndex
Int32

index of first element to be removed

toIndex
Int32

index after last element to be removed

Attributes

Exceptions

if removing from this list is not supported.

if start or start >= size().

Remarks

Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex, this operation has no effect.)

This method is called by the clear operation on this list and its subLists. Overriding this method to take advantage of the internals of the list implementation can substantially improve the performance of the clear operation on this list and its subLists.

Java documentation for java.util.AbstractList.removeRange(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to