I have a string like:
text-345-3535
The numbers can change.
How can I get the two numbers from it and store that into two variables?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try it out: http://jsfiddle.net/BZgUt/
This will give you an array with the last two number sets.
If you want them in separate variables add this.
Try it out: http://jsfiddle.net/BZgUt/1/
EDIT:
Just for fun, here’s another way.
Try it out: http://jsfiddle.net/BZgUt/2/