可能重复:
What's the best way to extract a one-dimensional array from a rectangular array in C#?
如何将矩形阵列复制到标准阵列?当然没有迭代每个项目......
double[,] rectArray = new double[3,3];
double[] linearArray = new array[9];
答案 0 :(得分:3)
您可以使用OfType
或Cast
方法:
linearArray = rectArray.OfType<double>().ToArray();
或者:
linearArray = rectArray.Cast<double>().ToArray();