PDA

View Full Version : How can I manipulate a variable's output?


biggs27
10-21-2002, 07:53 PM
I've got a variable that's pulled as a result of a search engine.

arrFileList(i) = path to the page found by the search engine (i.e., "Staffing/default.htm")

How can I manipulate the output of this variable to just give me "Staffing"? Basically, I need it to give me the information before the first /. It will not always be the same number of characters. If I need to create a new variable, I'm cool with that.

Thanks!

Brian

allida77
10-21-2002, 09:06 PM
strPath = "test/default.asp"
strPath = Mid(strPath,1,InStr(strPath,"/") - 1)

biggs27
10-21-2002, 09:11 PM
Worked like a charm! Thanks!!!

:D Brian

whammy
10-22-2002, 04:19 AM
You could also split it by the "/":

strPath = "test/default.asp"
temparray = split(strPath,"/")
strPath = temparray(0)