The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
HashSet<T>::Contains Method (T)
.NET Framework (current version)
Determines whether a HashSet<T> object contains the specified element.
Assembly: System.Core (in System.Core.dll)
Parameters
- item
-
Type:
T
The element to locate in the HashSet<T> object.
Return Value
Type: System::Booleantrue if the HashSet<T> object contains the specified element; otherwise, false.
Implements
ICollection<T>::Contains(T)This method is an O(1) operation.
The following example demonstrates how to remove values from a HashSet<T> collection using the Remove method. In this example, the Contains method verifies that the set contains a value before removing it.
Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Show: