Contains Method

HashSet<T>.Contains Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft