Case-Insensitive SortedList Keys

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Boy, the documentation for creating a SortedList whose text-based key will be
case-insensitive is impossible for me to understand.

I want to create a SortedList where the KEY for every element will always be
a String and where a lookup on that SortedList (SL["Xyz"]) will be
case-insensitive. Can someone please just tell me what to shove into the
Constructor to make that happen?

Thanks!

Alex
 
Hello Alex,

You can either write your own Comparer... or what I usually prefer to do
is just add all the keys lowercase: tList.Add(tKey.ToLower, tObject)

-Boo
 
Back
Top