Zeus2009
asked on
vb.net sort arraylist of dates
Hi All,
I am looking for a simple example of sorting an arraylist of dates in descending order.
i am using VS2005, vb.net, .Net 2
Thanks
Zeus
I am looking for a simple example of sorting an arraylist of dates in descending order.
i am using VS2005, vb.net, .Net 2
Thanks
Zeus
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
First of all, unless you are stuck with using framework 1.1, you should not be using an ArrayList at all. You should use a strongly typed generic List<DateTime> instead.
For custom sorting there is an overload of the Sort method that takes a comparer. By reversing the regular comparison you get a sort in descending order:
list.Sort(delegate(DateTim
Source: http://stackoverflow.com/questions/844251?sort=newest