C# – Case insensitive dictionary
Dictionaries with string keys are case sensitive by default. If you want a case-insensitive dictionary, use the Dictionary constructor that takes a string comparison option and pass in StringComparer.InvariantCultureIgnoreCase, like this: Note: There are other case-insensitive options you can pick from, such as OrdinalIgnoreCase. Example I have a table that maps users to devices. The … Read more