Friday, February 26, 2010

case sensitive dictionaries

This is just something I didn't know.
If I create a generic dictionary (a string, object Dictionary , for example), the keys are case sensitive. I'd spent hours of work trying to get around this. UNTIL, I found out that case sensitivity in Dictionaries is configurable.

new Dictionary...(StringComparer.OrdinalIgnoreCase);

solves the issue.

Just something to put on the stack.

No comments:

Post a Comment