January 1st, 2009
Sorting Generic Lists in C# - 2
Sorting a basic generic list in C# is trivial as long as you store basic elements such as strings or integers for which default comparison classes have been defined. In this post we will look into how we can reverse the string sort by implementing your own ICompare comparer, and how you can build your own comparison routines to compare other types. In the example we sort a list (List<>) of people by both their name and their age.



Except where otherwise noted, content on this site is