0

Possible Duplicate:
how to split a string in javascript

how can i split a string into a array in javascript ?

Community
  • 1
  • 1
crowso
  • 2,049
  • 9
  • 33
  • 38

1 Answers1

1

You can use split(), using a pattern that matches your separator :

>>> 'a,b,c'.split(/,/)
["a", "b", "c"]
Pascal MARTIN
  • 395,085
  • 80
  • 655
  • 663