How to use stringtokenizer in javascript?

Hi,

Is there anyway i can tokenize string using javascript?
If you have written your own method.. also it will be appreciated?

Regs,
Ravindra N
getravi2kAsked:
Who is Participating?
 
jonlondon12Commented:
Hey Ravindra,

you can;

var myArray = myString.split(",");

myArray will store an array of values split on the delimiter chat (shown above as a comma).

You can of course then iterate through the array to retrieve the value of each array element:

for (var i = 0 ; i < myArray.length ; i++){
           alert(myArray[$i]);
}
0
 
jonlondon12Commented:
sorry I typed 'delimiter chat' but of course meant delimeter 'char'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.