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"));
1.4m articles
1.4m replys
5 comments
57.0k users