Given a string delimited by commas, how would I go about splitting it into an array in javascript?
+3
A:
You can simply use the split() method on your string:
var myString = 'a,b,c';
var myArray = myString.split(',');
Daniel Vassallo
2010-08-26 16:21:54
+5
A:
var array = string.split(",") should do it where string is your string variable
Donald Matheson
2010-08-26 16:22:15
First answer after a year?! An upvote for you sir!
Crescent Fresh
2010-08-26 16:23:29