Export (0) Print
Expand All

HashSet<T>.Remove Method

Removes the specified element from a HashSet<T> object.

Namespace:  System.Collections.Generic
Assembly:  System.Core (in System.Core.dll)

public bool Remove(
	T item
)

Parameters

item
Type: T
The element to remove.

Return Value

Type: System.Boolean
true if the element is successfully found and removed; otherwise, false. This method returns false if item is not found in the HashSet<T> object.

Implements

ICollection<T>.Remove(T)

If the HashSet<T> object does not contain the specified element, the object remains unchanged. No exception is thrown.

This method is an O(1) operation.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft