Getting two double substrings from a string starting after a particular substring [on hold]

By | August 20, 2018

For an Android application, an API I’m using returns the following format response :

"2016-05-08T14:07:58.738Z" | Lat: 50.012122| Long: 50.012122| Precision: 22.44868"

I’m tring to extract the double after “Lat: ” and the one after “Long: ” in two Double using different versions of .substring. The code becomes quickly long because I make multiple calls to substring (to get the values after Lat and Long, and also to remove the | after and everything else).

I’m searching for a more succinct and noncomplex methot that I can’t see at the moment.

Thank you.


Leave a Reply

Your email address will not be published. Required fields are marked *