P
Paul E Collins
Shouldn't the CaseInsensitiveComparer sort case-insensitively?
The following code prints out 'AZaz', which indicates a case-sensitive sort.
What do I need to do to perform a case-insensitive sort ('AaZz')?
char[] chars = new char[] { 'A', 'z', 'a', 'Z' };
string sorted = "";
Array.Sort(chars, new System.Collections.CaseInsensitiveComparer());
for (int i = 0; i < chars.Length; i++)
{
sorted += chars;
}
Console.WriteLine(sorted);
The following code prints out 'AZaz', which indicates a case-sensitive sort.
What do I need to do to perform a case-insensitive sort ('AaZz')?
char[] chars = new char[] { 'A', 'z', 'a', 'Z' };
string sorted = "";
Array.Sort(chars, new System.Collections.CaseInsensitiveComparer());
for (int i = 0; i < chars.Length; i++)
{
sorted += chars;
}
Console.WriteLine(sorted);