METHOD
HashSet<T>.Overlaps
Tests whether any element of another sequence belongs to the set using the set comparer. Does not mutate the set.
Formal Syntax & Structure
csharp syntaxcsharp
set.Overlaps(other)Working Example
Example Snippetcsharp
using System;using System.Collections.Generic;var ids = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "A" };Console.WriteLine(ids.Overlaps(new[] { "a" })); // True