Thursday, 1 December 2011

Creating and Sorting Arrays in C#

private void csharp_array()
{
string[] arCities = {"","","",""};
arCities[0] = "Zurich";
arCities[1] = "Havana";
arCities[2] = "Amalapuram";
arCities[3] = "San Francisco";
//arnames
Array.Sort(arCities);
}
Array.Sort method sorts the elements in an entire one-dimensional Array using the IComparable implementation of each element of the Array.


Before Sorting


After Sorting


Sorting Arrays in C#, Creating Arrays in C#, Array.Sort in C#, Sorting One Dimensional arrays using C#, C# Array sort method

0 comments:

Post a Comment