Miguel Oz
asked on
How to order IEnumerable<string> in date ascending order?
I have the results of Directory.EnumerateFiles as follows: (date is YYYYMMDD format)
c:\download\20160912\targe t.csv
c:\download\20160915\targe t.csv
c:\download\20160914\targe t.csv
c:\download\20160913\targe t.csv
I would like to order in date ascending order:
c:\download\20160912\targe t.csv
c:\download\20160913\targe t.csv
c:\download\20160914\targe t.csv
c:\download\20160915\targe t.csv
c:\download\20160917\targe t.csv
Note: C# or VB.NET code is OK. please add you code as a method so it is easier to test and provide speedy feedback.
Thanks,
c:\download\20160912\targe
c:\download\20160915\targe
c:\download\20160914\targe
c:\download\20160913\targe
I would like to order in date ascending order:
c:\download\20160912\targe
c:\download\20160913\targe
c:\download\20160914\targe
c:\download\20160915\targe
c:\download\20160917\targe
Note: C# or VB.NET code is OK. please add you code as a method so it is easier to test and provide speedy feedback.
Thanks,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Guys and good point Gustav. Your solution is much smpler
You are welcome!
/gustav
/gustav
Open in new window
Produces the following output --saige-