I have this variable:
List<Points> pointsOfList;
it's contain unsorted points( (x,y) - coordinates);
My question how can I sort the points in list by X descending.
for example:
I have this: (9,3)(4,2)(1,1)
I want to get this result: (1,1)(4,2)(9,3)
Thank you in advance.
pointsOfList.OrderBy(p=>p.x).ThenBy(p=>p.y)
LINQ:
pointsOfList = pointsOfList.OrderByDescending(p => p.X).ToList();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With