开发者

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

开发者 https://www.devze.com 2023-02-14 06:59 出处:网络
I have an array of directory paths, and want to get all string[] dirs = ...; string[][] dirFiles = dirs.Select(Directory.GetFiles).ToArray();

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

精彩评论

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