User753101303 posted
Hi,
String.Join is to concatenate all values taken from an array with the given separator..It should output something such as :
Peter | 25 | 5.00
George | 34 | 6.00
Marry | 28 | 5.49
(seems easy to create a console app to test that with the exact input parameters you want). Edit: forgot the sort, the ordering is likely George, Marry, and Peter...
Edit2: while I'm at it you could just test yourself what yoou get with a test console app such as :
using System;
using System.Linq;
namespace ConsoleDemo
{
class Program
{
static void Main(string[] args)
{
string[][] jaggedArray = {
new string[]{"name", "age", "grade"},
new string[] { "Peter", "25", "5.00" },
new string[] { "George", "34", "6.00" },
new string[]{"Marry", "28", "5.49"} };
const int headerIndex = 0;
foreach (var row in jaggedArray.Skip(1).OrderBy(r => r[headerIndex]))
{
Console.WriteLine(string.Join(" | ", row));
}
}
}
}