Why does StringDictionary.Add use case-insensitive keys?

  • Thread starter Thread starter Kyle Blaney
  • Start date Start date
K

Kyle Blaney

In the remarks for the StringDictionary.Add method it states that "The
key is handled in a case-insensitive manner; it is translated to lower
case before it is added to the string dictionary."

Why is that done for StringDictionary.Add but not for the Add methods
in other similar classes like Hashtable? Is there any way to override
that behaviour and use StringDictionary with case-sensitive keys?

Kyle Blaney
 
Greets,

It's done for StringDictionary because it was designed as a specialized
collection. If you look at the rotor source code for the StringDictionary
class, they indeed use ToLower() on the key before adding or removing to the
collection. You could easily take this source and modify it to remove the
ToLower() calls.

Regards,

Joe
 
Back
Top