开发者

Is it possible to create one dimension array from two using LINQ?

I have an array of directory paths, and want to get all

string[] dirs = ...;
string[][] dirFiles = dirs.Select(Directory.GetFiles).ToArray();

No开发者_StackOverfloww I want to get the list of files in one dimension array, is it possible to convert this array to one dimension? And in general, is it possible to convert two dimension array to one by joining all togather using linq?


string[] dirFiles = dirs.SelectMany(Directory.GetFiles).ToArray();


string[] dirFiles = dirs.SelectMany(Directory.GetFiles).ToArray();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜