471,073 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

tokenize javascript string

I've got a long commaseparated string that I want to put into an
array. Is thera an easy way of doing this with javascript? I think
this is called tokenizing (?) but I couldn't find anything about it
anywhere on the net.

obs
Jul 20 '05 #1
1 20293
Hi,

Obscurr wrote:
I've got a long commaseparated string that I want to put into an
array. Is thera an easy way of doing this with javascript? I think
this is called tokenizing (?) but I couldn't find anything about it
anywhere on the net.

obs


JavaScript has a nice method called "split()". It is so nice that it has
been included into the .NET API too ;-)

function makeArray( strLongString )
{
return strLongString.split( "," );
}

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by qwweeeit | last post: by
9 posts views Thread by Lans | last post: by
4 posts views Thread by Kelvin | last post: by
2 posts views Thread by James | last post: by
5 posts views Thread by Lam | last post: by
20 posts views Thread by bubunia2000 | last post: by
1 post views Thread by Tim | last post: by
2 posts views Thread by askalottaqs | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.