Hi,
I have to get a directory file list, filtered on multiple extensions...and sorted!
I use this, which is the fastest way I've found to get dir content filtered on multiple extensions:
and then use an array sort.
I was wondering (and this is my question
) if there would be a way to do the sorting IN the same main line? A kind of:
and, if yes, if I would gain speed doing this instead of sorting the array at the end (but I would do my test and report..as soon as I get a solution!!)?
Thanks for your help!!
I have to get a directory file list, filtered on multiple extensions...and sorted!
I use this, which is the fastest way I've found to get dir content filtered on multiple extensions:
VB.NET:
Dim ext As String() = {"*.jpg", "*.bmp","*png"}
Dim files As String() = ext.SelectMany(Function(f) Directory.GetFiles(romPath, f)).ToArray
Array.Sort(files)
and then use an array sort.
I was wondering (and this is my question
VB.NET:
Dim files As String() = ext.SelectMany(Function(f) Directory.GetFiles(romPath, f)[B].Order By Name[/B]).ToArray
and, if yes, if I would gain speed doing this instead of sorting the array at the end (but I would do my test and report..as soon as I get a solution!!)?
Thanks for your help!!