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,790
  • 5
  • 26
  • 32

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
  • 258,201
  • 41
  • 486
  • 479