I have a string in the following format: 90000 - 90000 Where the numbers can be of a variable length, and then there is a space, hyphen, space between them. I\'m tr
90000 - 90000
You can use split function:
split
var s = '90000 - 90000'; var a = s.split(/[ -]+/); console.log(a);
Output:
["90000", "90000"]