I need to sort a highscore file for my game I\'ve written.
Each highscore has a Name, Score and Date variable. I store each one in a List.
Here is the struct tha
I don't know why everyone is proposing LINQ based solutions that would require additional memory (especially since Highscore is a value type) and a call to ToList() if one wants to reuse the result. The simplest solution is to use the built in Sort method of a List
list.Sort((s1, s2) => s1.Score.CompareTo(s2.Score));
This will sort the list in place.