I have a 2d array of strings
string [] [] myArray;
and I want to sort it by one of the columns.
So the data might be
{
you can do like this...
IEnumerable AsEnumerable(this T[,] arr) {
for(int i = 0; i < arr.GetLength(0); i++)
for(int j = 0; j < arr.GetLength(1); j++)
yield return arr[i, j];
}
And then write for example:
int[,] data = // get data somwhere
// After 'AsEnumerable' you can use all standard LINQ operations
var res = data.AsEnumerable().OrderBy(n => n).Reverse();