CSharp examples for System:Array Sort
Bubble Sort string array
using System.Text; using System.Security.Cryptography; using System.IO;/*from www. ja v a2s. com*/ using System; public class Main{ public static string[] BubbleSort(string[] r) { for (int i = 0; i < r.Length; i++) { bool flag = false; for (int j = r.Length - 2; j >= i; j--) { if (string.CompareOrdinal(r[j + 1], r[j]) < 0) { string str = r[j + 1]; r[j + 1] = r[j]; r[j] = str; flag = true; } } if (!flag) { return r; } } return r; } }