By default, the Dictionary is not case sensitive. But you can implement your own option to make it sensitive. (Maybe I'm wrong: D)
I had the same problem with Dictionary, but after trying many implementations of IEquality, finally I settled the score in LINQ.
string k = customers.Where(c => c.Key.Equals(valueToSearch, StringComparison.OrdinalIgnoreCase)).FirstOrDefault().Key; if (!string.IsNullOrEmpty(k) && k.ToUpper() == valueToSearch.ToUpper()) {
Hope this helps someone in the future.
Sanjay Zalke
Sanjay zalke
source share