HashSet<T>.Overlaps Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Determines whether the current HashSet<T> object and a specified collection share common elements.

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

Syntax

'Declaration
Public Function Overlaps ( _
    other As IEnumerable(Of T) _
) As Boolean
public bool Overlaps(
    IEnumerable<T> other
)

Parameters

Return Value

Type: System.Boolean
true if the HashSet<T> object and other share at least one common element; otherwise, false.

Implements

ISet<T>.Overlaps(IEnumerable<T>)

Exceptions

Exception Condition
ArgumentNullException

other is nulla null reference (Nothing in Visual Basic).

Remarks

This method is an O(n) operation, where n is the number of elements in other.

Version Information

Silverlight

Supported in: 5, 4

Platforms

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