'split' function dosn't work ONLY on IOS


#1

Hi,

I have a problem that I have just identified the cause but I really don’t understand WHY!
To be simple, I just wanted to cut in two parts my GPS localisation : "-36.8461969;174.7694556"
I used this code :
let coord = this.profilInfo.Last_GPS_position.split(";");
But I don’t know what this solution work everywhere including on android device AND ios Emulator BUT not on REAL IOS devices!

To arrive at my conclusion that is the “split” function that doesn’t work, I had tried with this code and it’s working on IOS devices :

    let coord = [];
    coord[0]='-36.8461969';
    coord[1]='174.7694556';

If someone knows why, I really want to know why.
However if you have a good alternative, I am also OK to learn?

Thank you for your answers.


#2

please can I have some help


#3

If I had to bet, I would bet that split works on iOS real devices too…

Have you try to debug to confirm that your position before split isn’t null or empty?

console.log(this.profilInfo.Last_GPS_position);

Or an error occurs? What’s the stacktrace of the error?