Thursday, December 9, 2010

Sorting array of strings in C#

Sorting an array of strings is easy The Array.Sort Method takes care of this.



string[] sw = new string[500];
// input data into array                            
Array.Sort(sw);
foreach (string s in sw)
{
if (s != null)
 Label1.Text += s + "<br />";
}

No comments:

Post a Comment