Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 471 Bytes

File metadata and controls

19 lines (14 loc) · 471 Bytes

Arrays

joining arrays

string[] folderPaths;
folderPaths = System.IO.Directory.GetDirectories(pathFolder);
string[] filePaths;
filePaths = System.IO.Directory.GetFiles(pathFolder, "*.*");

paths = new string[filePaths.Length + folderPaths.Length];

// join like this
Array.Copy(folderPaths, paths, folderPaths.Length);
Array.Copy(filePaths, 0, paths, folderPaths.Length, filePaths.Length);

// or like this
paths = folderPaths.Union(filePaths).ToArray();