Array.Sort
using System;
class MainClass
{
public static void Main()
{
char[] charArray = {'w', 'e', 'l', 'c', 'o', 'm', 'e'};
Array.Sort(charArray); // sort the elements
Console.WriteLine("Sorted charArray:");
for (int i = 0; i < charArray.Length; i++)
{
Console.WriteLine("charArray[" + i + "] = " +
charArray[i]);
}
}
}
Related examples in the same category