how to order an arraylist in descending order in c#
availableTags.Sort();
availableTags.Reverse();
how to order an arraylist in descending order in c#
availableTags.Sort();
availableTags.Reverse();
list sorting c#
using System.Linq;
//sorts in acending order {1,2,3,4,5}
myList.Sort();
//Sorts in decending order {5,4,3,2,1}
myList.Sort();
myList.Reverse();
//to sort a custom list of classes you have to
//add this inside of your class
public int CompareTo(MyClass other)//replace MyClass with your class type
{
//replace varInClass to the variable that you would like to compare
return this.totalScore.CompareTo(other.varInClass)
}
c# return list in descending order
list.OrderByDescending();
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us