I try to order this 2d-array [10000, 150] with LINQ. I want to order it dependent of the second column. And I can't use a one-dimensional array.
namespace test2 {
class Test {
public static void Main() {
string[,] array = new string[,]
{
{"cat", "dog"},
{"bird", "fish"},
};
array = array.OrderBy (a => a [1]);
}
}
}
But I get the error: /home/Program.cs(18,18): Error CS0411: The type arguments for method `System.Linq.Enumerable.OrderBy(this System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly (CS0411) (test2)
How can I specify the type arguments?
Thanks for your help!