Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check file exists conundru

Status
Not open for further replies.

proximity

Technical User
Sep 19, 2002
132
GB
Hi,

Here is one I am not sure about . . . or rather, can't figure out how to handle it using FileExists!!!

My files look like this:
prtx010.prtx010.0199.E7.352.23444151

I want to check a directory for any files that are 36 characters long with E1 to E9 in its name.

Any ideas how I can achieve that?

Many thanks.
 
Since your file names will be a collection of strings, you can loop through and do something like this:
var x = yourFileName.Length;
var y = yourFileName.Contains("StringYouAreLookingFor");


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top