Dela via


IList.Remove Method

Definition

Overloads

Remove(Int32)

Removes the element at the specified position in this list (optional operation).

Remove(Object)

Removes the first occurrence of the specified element from this list, if it is present (optional operation).

Remove(Int32)

Removes the element at the specified position in this list (optional operation).

[Android.Runtime.Register("remove", "(I)Ljava/lang/Object;", "GetRemove_IHandler:Java.Util.IListInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Lang.Object? Remove (int index);
[<Android.Runtime.Register("remove", "(I)Ljava/lang/Object;", "GetRemove_IHandler:Java.Util.IListInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Remove : int -> Java.Lang.Object

Parameters

index
Int32

the index of the element to be removed

Returns

the element previously at the specified position

Attributes

Exceptions

if removing from this List is not supported.

if location = size()

Remarks

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Java documentation for java.util.List.remove(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

Remove(Object)

Removes the first occurrence of the specified element from this list, if it is present (optional operation).

[Android.Runtime.Register("remove", "(Ljava/lang/Object;)Z", "GetRemove_Ljava_lang_Object_Handler:Java.Util.IListInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool Remove (Java.Lang.Object? o);
[<Android.Runtime.Register("remove", "(Ljava/lang/Object;)Z", "GetRemove_Ljava_lang_Object_Handler:Java.Util.IListInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Remove : Java.Lang.Object -> bool

Parameters

o
Object

element to be removed from this list, if present

Returns

true if this list contained the specified element

Implements

Attributes

Exceptions

if removing from this List is not supported.

Remarks

Removes the first occurrence of the specified element from this list, if it is present (optional operation). If this list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that Objects.equals(o, get(i)) (if such an element exists). Returns true if this list contained the specified element (or equivalently, if this list changed as a result of the call).

Java documentation for java.util.List.remove(java.lang.Object).

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