I have an array of directory paths, and want to get all
string[] dirs = ...;
string[][] dirFiles = dirs.Select(Directory.GetFiles).ToArray();
Now 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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With