HashSet<T>.IntersectWith Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Modifies the current HashSet<T> object to contain only elements that are present in that object and in the specified collection.
Namespace: System.Collections.Generic
Assembly: System.Core (in System.Core.dll)
Parameters
- other
- Type: System.Collections.Generic.IEnumerable<T>
The collection to compare to the current HashSet<T> object.
Implements
ISet<T>.IntersectWith(IEnumerable<T>)| Exception | Condition |
|---|---|
| ArgumentNullException |
other is null. |
If the collection represented by the other parameter is a HashSet<T> collection with the same equality comparer as the current HashSet<T> object, this method is an O(n) operation. Otherwise, this method is an O(n + m) operation, where n is Count and m is the number of elements in other.
Windows 8 Consumer Preview, Windows Server 8 Beta, Windows 7, Windows Server 2008 SP2, Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.