Hi, All
Could anybody tell me how i split a string onto an array.
I know some javascript but not enough to do this, i'll try to
explain....
I have a string that looks like this...
var s="$2111*bob*22*gold$3221*paul*26*silver$5476*sam*45*iron";
note: the amount of '$' characters can be anything from 1 to 15, but the amount of '*' characters is always 3 within the '$' characters.
I'm trying to firstly split the string at the '$' character
as it's the start of a new table row, then split every '*' character into and array so i can name them and use them to write the html, for example if I split the first one i could name it userID...
s[0]=userID;
then use it in html like..
document.write("<span id="+userID+">");
and do the same with the three remaining userName,age,metal)
Thanks for reading, and help or links to point me in the right direction would be great.
Could anybody tell me how i split a string onto an array.
I know some javascript but not enough to do this, i'll try to
explain....
I have a string that looks like this...
var s="$2111*bob*22*gold$3221*paul*26*silver$5476*sam*45*iron";
note: the amount of '$' characters can be anything from 1 to 15, but the amount of '*' characters is always 3 within the '$' characters.
I'm trying to firstly split the string at the '$' character
as it's the start of a new table row, then split every '*' character into and array so i can name them and use them to write the html, for example if I split the first one i could name it userID...
s[0]=userID;
then use it in html like..
document.write("<span id="+userID+">");
and do the same with the three remaining userName,age,metal)
Thanks for reading, and help or links to point me in the right direction would be great.