// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Threading; using System.Globalization; namespace E { public class Program { public static void Main(string[] args) { string[] aa = new string[] { "aaa", "aab", "bba" }; Array.Sort(aa); foreach (string str in aa) { Console.WriteLine(str); } Array.Sort(aa, (s1,s2) => String.Compare(s1, s2, StringComparison.InvariantCulture)); foreach (string str in aa) { Console.WriteLine(str); } Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Array.Sort(aa); foreach (string str in aa) { Console.WriteLine(str); } } } }