Alright, usually if you are trying to extract things from a string, you need to figure out:
- what you DONT want in the string
- How you can distinguish between the things you DO want
In your case, what you don't want is parentheses and spaces. In JS, there is a function you can call on strings called replace(substr,replacement) which will do exactly what it sounds like.
Lets assume your paired string is called latLong. Once you've removed what you don't want:
latLong.replace(/[()\s]/g, "");
then you can split up the string based on the delimiter between them (the comma) using the split() method
var latLongArray = latLong.split(",");
The split() method will divide a string up into an array of substrings, separated by the argument you pass it.
So at the end of this, your latLongArray will be an array containing 2 elements (the latitude and longitude)!