title: Read a portion of ArrayList for n times of lines?
body: <p>If you have a HTML page stored in String ArrayList, and you want to for example read the whole <code>&lt;div&gt;</code> tag of certain class type, how do you read the next lines so that it would reach the end of div tag?</p>
  
  <pre><code>for (String l : line) {
      if (l.contains("&lt;div class=\"somne_class\"&gt;"){
  
        //read the next n strings in ArrayList until &lt;/div&gt; tag is reached
  }
  </code></pre>