I have a String with value as:
String lstr = [12.88, 77.56],[12.81, 77.7156]
....so on
I need to parse and iterate it and somehow substitute the values as :
final ArrayList<Coordinate> points = new ArrayList<Coordinate>();
points.add(new Coordinate(12.88, 77.56));
points.add(new Coordinate(12.81, 77.7156));
i tried converting string to List and then iterating it using for loop, but it is not working, either it goes out of bound or extra square bracket throws an exception. What is the best way to parse, format and iterate a string like this?