Hello,
I need help with string manipulation in the following string:
"My current Location In Latitude & Longitude:12.924273214302957 - 77.66566847451031"
I want to assign the latitude and longitude numbers separately to different variables.
Note that since these are coordinates, the lengths of the two numbers can vary based on position, so cannot use fixed index values with substring.
Hello,
For the benefit of everyone, found and posting another way to do this...
B4X:
Dim Latitude as Int
Dim Longitude as Int
Dim ColonIndex As Int
Dim DashIndex As Int
ColonIndex = Smstext.IndexOf(":")
DashIndex = Smstext.IndexOf("-")
Latitude = Smstext.SubString2(ColonIndex + 1, DashIndex)
Longitude = Smstext.SubString(DashIndex + 1)
Log(Latitude & " " & Longitude)