1

I have string like 962=962&961=961&485=485

I want to save the values into an array.

I may be asking a silly question, but I got stuck here.

Thanks

user1559230
  • 2,600
  • 5
  • 23
  • 31

1 Answers1

1

If you want all the values, you can pass a regular expression to split():

>>> "962=962&961=961&485=485".split(/[=&]/)
["962", "962", "961", "961", "485", "485"]
Frédéric Hamidi
  • 249,845
  • 40
  • 466
  • 467