A
Andrew Jocelyn
Hi
I need to do a case insensitive search on a Generic list. I'm trying to use
the BinarySearch method but I get a complier error "cannot convert from
'System.Collections.CaseInsensitiveComparer' to
'System.Collections.Generic.IComparer<string>' "
List<string> list = new List<string>();
list.Add(str1);
list.Add(str2);
list.Add(str3);
int index = list.BinarySearch(otherstr, new CaseInsensitiveComparer());
What's the correct procedure?
Thanks
Andrew
I need to do a case insensitive search on a Generic list. I'm trying to use
the BinarySearch method but I get a complier error "cannot convert from
'System.Collections.CaseInsensitiveComparer' to
'System.Collections.Generic.IComparer<string>' "
List<string> list = new List<string>();
list.Add(str1);
list.Add(str2);
list.Add(str3);
int index = list.BinarySearch(otherstr, new CaseInsensitiveComparer());
What's the correct procedure?
Thanks
Andrew