[Solved] Sort list numericallyC# [closed]
You can in-place sort scores if you want, using List.Sort(Comparison<T>): scores.Sort((a, b) => int.Parse(a.Punten).CompareTo(int.Parse(b.Punten))); Note that because Punten appears to be a string, you need to convert it to an int to compare properly. If you change your code to make Punten an int, the sorting code would simplify to: scores.Sort((a, b) => a.Punten.CompareTo(b.Punten)); What’s … Read more