多维数组操作

1. 多转1:

int[,] array2 = {{1,2,3},{4,5,6},{7,8,9}};

int[] array1 = array2.OfType<int>().ToArray();

 

int[][] array2 = {new[]{1,2,3},new[]{4,5,6},new[]{7,8,9}};

int[] array1 = array2.SelectMany(i=>i);

posted @ 2012-05-15 12:19  Eric Fine  阅读(250)  评论(0编辑  收藏  举报