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();
精彩评论