M
Mark Rae
Hi,
Is it possible to create a case-insensitive List<string> collection?
E.g.
List<string> MyList = 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,
string> collections e.g.
Dictionary<string, string> MyDictionary = new Dictionary<string,
string>(StringComparer.CurrentCultureIgnoreCase);
but I can't find an equivalent for List<string>...
Any assistance gratefully received.
Mark
Is it possible to create a case-insensitive List<string> collection?
E.g.
List<string> MyList = 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,
string> collections e.g.
Dictionary<string, string> MyDictionary = new Dictionary<string,
string>(StringComparer.CurrentCultureIgnoreCase);
but I can't find an equivalent for List<string>...
Any assistance gratefully received.
Mark