What I want to achieve is an alphabetically sorted nested list.
eg. my input:
fat, twat, gat //Line 1 cat, hat, bat // Line 2 twat, lack, rat // Line 3
I want the output to be:
bat, cat, hat // Line 2 fat, gat, twat // Line 1 lack, rat, twat // Line 3
As you can see, the list is first sorted internally as well as externally.
My implementation currently uses a nested list:
List<List<String>> testSort;
I managed to sort the internal list using this method:
public static List<List<String>> sortList(List<List<String>> input) { input.ForEach(delegate (List<string> o) { o.Sort(); }); return input; }
I am not sure how to sort the list outside. Help will be appreciated!
Thanks in advance!
source share