indexOf returns incorrect result
Posted: 23 Sep 2019 18:50
Hello,
I've stored my current location in the "location" string. It is currently something like "40.245,29.085".
I need to change the longtitude and langtitude values from the location string.
I've tried to get the comma location by using indexOf like this but it returns 23. It should be 9.
X=indexOf(location, ",");
Then I've tried to split it,
X=split(location, ",")[0];
But it returns "Location[fused 40***"
Then I've tried
X=left(location, 9);
But it also returns "Location[fused 40***"
Most probably I've missed something.
How can I performs split, indexOf, left operations on string?
Regards.
I've stored my current location in the "location" string. It is currently something like "40.245,29.085".
I need to change the longtitude and langtitude values from the location string.
I've tried to get the comma location by using indexOf like this but it returns 23. It should be 9.
X=indexOf(location, ",");
Then I've tried to split it,
X=split(location, ",")[0];
But it returns "Location[fused 40***"
Then I've tried
X=left(location, 9);
But it also returns "Location[fused 40***"
Most probably I've missed something.
How can I performs split, indexOf, left operations on string?
Regards.