I am trying to split values in string, for example I have a string:
var example = "X Y\nX1 Y1\nX2 Y2"
and I want to separate it by spaces and \n
so I want to get something like that:
var 1 = X
var 2 = Y
var 3 = X1
var 4 = Y1
And is it possible to check that after the value X
I have an Y
? I mean X
and Y
are Lat and Lon so I need both values.