Compartir a través de


ICollection.Remove(Object) Method

Definition

Removes a single instance of the specified element from this collection, if it is present (optional operation).

[Android.Runtime.Register("remove", "(Ljava/lang/Object;)Z", "GetRemove_Ljava_lang_Object_Handler:Java.Util.ICollectionInvoker, 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.ICollectionInvoker, 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 collection, if present

Returns

true if an element was removed as a result of this call

Attributes

Exceptions

if removing from this Collection is not supported.

if the object passed is not of the correct type.

if object is null and this Collection doesn't support null elements.

Remarks

Removes a single instance of the specified element from this collection, if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).

Java documentation for java.util.Collection.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