HashSet<T>.Contains Method

Determines whether a HashSet<T> object contains the specified element.

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

public bool Contains(
	T item
)

Parameters

item
Type: T
The element to locate in the HashSet<T> object.

Return Value

Type: System.Boolean
true if the HashSet<T> object contains the specified element; otherwise, false.

Implements

ICollection<T>.Contains(T)

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: