Sort Array using the IComparable implementation of each element of the Array in CSharp
Description
The following code shows how to sort Array using the IComparable implementation of each element of the Array.
Example
// w w w . jav a 2 s .c o m
using System;
using System.Collections;
public class SamplesArray {
public static void Main() {
String[] myArr = { "The", "A", "W", "X", "V", "Q", "!", "2", "3" };
Array.Sort( myArr );
foreach(String s in myArr){
Console.WriteLine(s);
}
}
}
The code above generates the following result.