How to ignore case in dictionary keys? I'm doing this:
var map = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
map.Add("e", "Letter e lower case");
string value = null;
if (!map.TryGetValue("E", out value)) {
Console.WriteLine("Not found");
}
And I already tried to use StringComparer.InvariantIgnoreCase, and the result is the same. It cannot find the letter "E" in uppercase.
EDIT: Could I'm having some kind of culture conflicts with my environment settings even using OrdinalIgnoreCase ?