Mark,
No, the List does not support any other comparison for Contains. You
will have to use the dictionary method to determine if you have a
case-insensitive string in your set.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:Og****************@TK2MSFTNGP05.phx.gbl...
Hi,
Is it possible to create a case-insensitive List<stringcollection?
E.g.
List<stringMyList = new List<string>;
MyList.Add("MyString");
So that:
MyList.Contains("mystring")
MyList.Contains("MyString")
MyList.Contains("MYSTRING")
all return true.
Google shows plenty of examples of how to do this with Dictionary<string,
stringcollections e.g.
Dictionary<string, stringMyDictionary = new Dictionary<string,
string>(StringComparer.CurrentCultureIgnoreCase);
but I can't find an equivalent for List<string>...
Any assistance gratefully received.
Mark