I am using the statement
DirectoryInfo.EnumerateFiles(filter) where filter is a string. I want to set filter to be able to search for 2 different strings. How can I do that?
If I search for one string then:
filter = "CM_*";
But I want to search for 2 different strings.
Should I use:
filter = "CM_*, CDH_*";
I search online and cannot find the answer or if I can do this. Filter is a parameter coming in and it all has to be in one field. I thought I had figured it out but I cannot remember what I did.
Thanks,
arep
Loading
repaskyPosted Jul 14, 2012, 8:12 PM
arep
A RepaskyPosted Jul 12, 2012, 1:57 PM
arep
VulpesPosted Jul 11, 2012, 7:17 PM
http://msdn.microsoft.com/en-us/library/8he88b63.aspx
What I'd suggest you do is to split the incoming filter into two using the comma as separator. You then need to apply the two filters separately and (if necessary) amalgamate the resulting FileInfo arrays into a single array.