Parsing and iterating String to arraylist : <p>I have a String with value as:</p>

<blockquote>
  <p>String lstr = [12.88, 77.56],[12.81, 77.7156]</p>
</blockquote>

<p>....so on</p>

<p>I need to parse and iterate it and somehow substitute the values as :</p>

<pre><code>final ArrayList&lt;Coordinate&gt; points = new ArrayList&lt;Coordinate&gt;();
        points.add(new Coordinate(12.88, 77.56));
        points.add(new Coordinate(12.81, 77.7156));
</code></pre>

<p>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?</p>
