What is selectMany.ToArray()
method? Is it a built in method in C#
?
I need to convert two dimensional array to one dimensional array.
If you mean a jagged array (T[][]
), SelectMany
is your friend. If, however, you mean a rectangular array (T[,]
), then you can just enumerate the date data via foreach
- or:
int[,] from = new int[,] {{1,2},{3,4},{5,6}};
int[] to = from.Cast<int>().ToArray();