In a .NET code, I have a loop that takes all .wav files from D:\Temp and its subdirectories :
string[] fileHolder = Directory.GetFiles("D:\\Temp","*.wav", SearchOption.AllDirectories);
I want to exclude all .wav files coming from folders that have “blablabla” in their folder name.
How do do this ?
P.S. This is similar to Exclude directories that contain sub directories?, but I haven’t been able to use successfully the answers of this topic.
Adding several conditions:
Another solution: (I think that Path.GetDirectoryName is not fastest possible operation)
Usage: