Extracting string from a string

VegaLA

Registered User.
Local time
Yesterday, 16:49
Joined
Jul 12, 2006
Messages
101
Good day all,
i'm trying to grab a string from another string.
I have tried using instr, mid, right, left etc..etc but not having any success due to the fact I want the string search to start at the end of the string and go left, stopping untill it finds the first (last from left) "\" character. I used Len to get the last char postion and then the Instr function to get that postion. From there I can extract the string I want, for example:

C:\Folder\work\MyFile.txt

I would want to extract myfile.txt as a string but the string could quite easily be :

C:\base\projx\work\Mystuff.dbf

and I would need to extract mystuff.dbf into a string. I've played around with the instr, Mid and Right functions but no joy. Can anyone pelase assist?

Thanks in advance,
Mitch......
 
You can use InStrRev to find the last backslash, along with the Mid function.
 
Thank you Paul, that works perfectly!
 
No problemo, happy to help.
 

Users who are viewing this thread

Back
Top Bottom