The line below fetches all files that start with Cake.
Dim fi As System.IO.FileInfo() = di.GetFiles("Cake*")
How can i write the search pattern to get all the files, that do not start with Cake?
The line below fetches all files that start with Cake.
Dim fi As System.IO.FileInfo() = di.GetFiles("Cake*")
How can i write the search pattern to get all the files, that do not start with Cake?
You get all the files that start with something and use all that are not in that list and are in the original list?
This will be in C#, but it should get you close.
FileInfo fi[] = di.GetFiles();
var doNotFiles = fi.Where(file => !file.Name.StartsWith("Cake"));
Just wanted to give the VB.Net version (converted from @Daniel A. White's C# version) in case anyone else stumbles on this.
Dim FI = DI.GetFiles().Where(Function(f) Not f.Name.StartsWith("Cake"))