I'm trying to sort the following List
List<char[]> permutations = new List<char[]>();
it contains all the permutations of the number 0,1,2,3,4,5,6,7,8,9 however they are not sorted but I need them sorted. This is what I did to fix my problem :
permutations = permutations.OrderBy(arr1 => arr1[9]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[8]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[7]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[6]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[5]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[4]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[3]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[2]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[1]).ToList();
permutations = permutations.OrderBy(arr1 => arr1[0]).ToList();
how can I avoid this or how can this be written in 1 line ?