title: Java: How To Grab Each nth Lines From a String
body: <p>I'm wondering how I could grab each nth lines from a String, say each 100, with the lines in the String being seperated with a '\n'.</p>
  <p>This is probably a simple thing to do but I really can't think of how to do it, so does anybody have a solution?</p>
  <p>Thanks much,
  Alex.</p>
  <p><strong>UPDATE:</strong>
  Sorry I didn't explain my question very well.</p>
  <p>Basically, imagine there's a 350 line file. I want to grab the start and end of each 100 line chunk. Pretending each line is 10 characters long, I'd finish with a 2 seperate arrays (containing start and end indexes) like this:</p>
  <blockquote>
  <p>(Lines 0-100) 0-1000</p>
  <p>(Lines 100-200) 1000-2000</p>
  <p>(Lines 200-300) 2000-3000</p>
  <p>(Lines 300-350) 3000-3500</p>
  </blockquote>
  <p>So then if I wanted to mess around with say the second set of 100 lines (100-200) I have the regions for them.</p>