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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Searching

Status
Not open for further replies.

iamapollo

MIS
Aug 22, 2001
38
AU
Hi

I have a program that keeps track of a file name, but it is the full path. I want to extract from that string just the filename. I thought of using instr but it only searches forward and I need to start from the end and extract the string until it hits the final \.

Any ideas?
Thanks

Michael
 
Look up InStrRev function - it does just what you want!
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Thanks a lot johnwm, I knew it was something simple like that.

If anyone else is interested the following statement is what worked:
Right(strCurrentFileName, Len(strCurrentFileName) - InStrRev(strCurrentFileName, "\"))

 
Yes For those all string , text search problems , we need should use.
"TEXT FUNCTIONS" like: -
Left , Right , Mid , InStr , InStrRev , Len , Format , etc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top