I’m trying to parse a string but I’m not sure how to parse it because its not a simple comma parse or something like that. The string i have is similar to this:
String s = "[\"142.5,106.1\",\"142.5,112.1\",\"143.5,119.1\",\"144.5,128.1\",\"146.5,138.1\",\"147.5,148.1\"]";
the string is coming from a jsonarray so that why the format is what it is, but my goal is parse this to a list. So the 142.5,106.1 is the x,y coordinates of one point and so on and so on. Anyone point me in the right direction for this? Thanks.
You could simply use a StringTokenizer(“\”[,]”) and then read two values at a time (x, y, x, y, etc.).