I have List<List<string>>
and need to sort the main list according to some elements of the secondary see the illustration below.
Ineedthefirstleveltobeinalphabeticalorder,andthesecondlevelisinascendingorderbutaccordingtothenumbers.Forexamplethenumber26hastocomebefore1000.
Thecodebelowdoessomethingsimilarbutatthesecondlevelitsortsaccordingtostring
,sothe1000comesbeforethe26th.
varMySortedList=MyUnsortedList.OrderBy(x=>x[1]).ThenBy(x=>x[2]);
IwouldhavetoconvertittointanddothesortinghoweverinsomestringsIhave/
and-
.InthiscaseitwouldhaveaException
.Ihavenoideahowtoimplementit.