How to split string in typescript ionic?


I have a variable string with value like this : "-34.9290,138.6010"
and now I want to split to two variable, one varible to save “-34.9290” and one to save "138.6010"
can someone help me?
I try substring & indexOf function, but when running on device its not working


You can just use normal Javascript functions, so the best option here would be to use:


which will return an array of the two values.