I am trying to understand a piece of code but I am not sure I do. I will be very grateful if someone could explain to me what happens here:
foreach (var row in jaggedArray.Skip(1).OrderBy(r => r[headerIndex]))
{
Console.WriteLine(string.Join(" | ", row));
}I suggest that .Skip(1) misses the first row, but after that, I did not understand anything. I will give you an example of what this code does:
4 name, age, grade Peter, 25, 5.00 George, 34, 6.00 Marry, 28, 5.49 sort name
This is an example input. Our jagged array has 4 rows and 3 columns. We have to sort the name header so in this case, the header index is equal to 0. Thank you advance!