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
  • 1,969
  • 8
  • 32
  • 38

1 Answers1

1

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

>>> 'a,b,c'.split(/,/)
["a", "b", "c"]
Pascal MARTIN
  • 385,748
  • 76
  • 642
  • 654