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