views:

44

answers:

3

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?

A: 

You get all the files that start with something and use all that are not in that list and are in the original list?

sklitzz
+1  A: 

This will be in C#, but it should get you close.

FileInfo fi[] = di.GetFiles();
var doNotFiles = fi.Where(file => !file.Name.StartsWith("Cake")); 
Daniel A. White
A: 

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"))
Chris Haas