Shouldn't the CaseInsensitive Comparer 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(char s, new System.Collecti ons.CaseInsensi tiveComparer()) ;
for (int i = 0; i < chars.Length; i++)
{
sorted += chars[i];
}
Console.WriteLi ne(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(char s, new System.Collecti ons.CaseInsensi tiveComparer()) ;
for (int i = 0; i < chars.Length; i++)
{
sorted += chars[i];
}
Console.WriteLi ne(sorted);
Comment