String manipulation

Garry Clarke
10-03-2001, 10:30 PM
It seems I not the only one trying to extract info from within a string variable.
Hope someone can help.
From my string "C:\xxxxx\xxxxxx\xxx\XXXXXX\recent.mdb"
while it can be any length I need the folder name for the XXXXXX section of the string.

Timbo
10-03-2001, 10:47 PM
Thinker made this (http://www.visualbasicforum.com/bbs/showthreaded.php?Cat=&Board=visbas&Number=50903&Search=true&Forum=CatSearch-1&Words=instrrev&Match=Entire%20Phrase&Searchpage=0&Limit=25&Old=3weeks&Main=50900) suggestion a short while ago...

"He who dares my son!.. He who dares.." - Del-Boy Trotter

dcl3500
10-03-2001, 10:47 PM
You might try looking up the instr function. There is a reverse of that function whose name escapes me right offhand.



Don

Time is the best teacher; unfortunately it kills all its students.

Timbo
10-03-2001, 11:15 PM
but for your needs you'll want to go:

strFolder$ = Mid$(strPath$,InStrRev(strPath$,"\") +1 ,InStrRev(strPath$,"\"))



"He who dares my son!.. He who dares.." - Del-Boy Trotter

Garry Clarke
10-04-2001, 04:37 AM
Ta Ill give them a go
garry

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum