Mono Class Library: System.Collections.Generic.ICollection<T> Overview | Members

System.Collections.Generic.ICollection<T>.Remove Method

Removes the first occurrence of an item from the current collection.

public bool Remove (T item)

Parameters

item
The item to remove from the current collection.

Returns

true, if item was removed from the current collection; false if item was not found in the current collection.

Exceptions

TypeReason
NotSupportedExceptionThe current collection is read-only.

Remarks

If item was found, but cannot be removed for some reason, some unspecified exception is thrown.

Implementations of this interface can vary in how they determine equality of objects; for example, some types use the default comparer, while others allow the user to specify the comparer to be used.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0