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

parsing strings

Status
Not open for further replies.

blueindian1

Programmer
Apr 24, 2001
150
US
Hello All,

Here is my problem. I have a hidden field called theField on formA that contains the following:

"Dogs&Cats&Birds&Snakes&Rhinos"

I submit the form, and on the next page have
Code:
dim var
var = reqest.form("theField")

My question is this: what's the best way to parse the individual terms out of the string such that I can set individual variables equal to "Dogs", "Cats", "Birds", etc..

Thanks!
 
dim var, varArray
var = reqest.form("theField")
varArray = split(var,"&")

you now have an array... each of the individual elements holding the words that fall between the & signs in your 'var' variable.

:)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top