c# list string sort alphabetically code example
Example 1: how to sort string array alphabetically in c#
Array.Sort(names, (x,y) => String.Compare(x.Name, y.Name));
Example 2: c# list sort by property string
list.Sort((a, b) => a.StringProperty.CompareTo(b.StringProperty));