How to use HashSet<string>.Contains()
method in case -insensitive mode?
You can create the HashSet
with a custom comparer:
HashSet<string> hs = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
hs.Add("Hello");
Console.WriteLine(hs.Contains("HeLLo"));