Hope someone can help. I have created a variable length array that will accept several name inputs. I now want to sort the array in alphabetical order and return that to the
Create a comparer class
class StudentComparer : IComparer<Student> { public int Compare(Student a, Student b) { return a.Name.CompareTo(b.Name); } }
Sort:
Array.Sort(students,new StudentComparer());