View Full Version : Split-up

02-28-2003, 11:00 AM

I've got a feeling this may actually be a JS problem, but there may also be ways to do it in ASP that I would understand better. I have a value in my db that is along the format of 1_1, or 2_4 etc. I need to pull that out in one of my pages, but then source some text values against the first number from one table, and then another text value for the second value from another table. Obviously I know how to use a WHERE statement ot get the data I want, but how do I split the *_* value up into two separate parts? Hope you can help.


02-28-2003, 12:26 PM
Using the split function will seperate the string into an array, thus:

ArrayName = Split("1_1","_") will split the string at each instance of _.

Then you can use:

ArrayName(0) to retrieve the first value
ArrayName(1) to retrieve the 2nd

03-01-2003, 02:46 AM
What he said ^^. ;)