title: How to split a string based on empty/blank lines?
body: <p>I'm writing a c++ application (Qt Widgets) that is supposed to parse an .srt subtitle file. Each part of the file is separated by an empty line, like this:</p>
  <pre><code>1
  00:00:08,000 --&gt; 00:00:11,000
  [Line]
  
  2
  00:00:56,034 --&gt; 00:00:57,492
  [Line]
  [Another line]
  
  3
  00:01:13,676 --&gt; 00:01:15,420
  [Line]
  </code></pre>
  <p>Basically, I want to read the entire file to a <code>QString</code>, and split it by empty lines into <code>QString</code> array, each item containing one of those sections like this:</p>
  <pre><code>2
  00:00:56,034 --&gt; 00:00:57,492
  [Line]
  [Another line]
  </code></pre>
  <p>However, I cannot figure out how to do this. I tried splitting the string by <code>\r</code> and <code>\n</code>, but that split everything into separate lines, not by empty lines.</p>
  <p>This is the routine I had in mind to get the data from the .srt file:</p>
  <ul>
  <li>Read all of the contents of the file to a <code>QString</code> (named something along the lines of <code>content</code>).</li>
  <li>Split the <code>QString</code> by empty lines, and append to a <code>QStringList</code> (named something along the lines of <code>sections</code>).</li>
  <li>For each item in <code>sections</code>, split the second line by the <code>--&gt;</code> identifier, and assign indexes <em>0</em> and <em>1</em> to <code>QString</code> variables called <code>startTime</code>, and <code>endTime</code>, respectively.</li>
  <li>Take the rest of the lines (everything after line 2 is the subtitle text), and append them to a <code>QString</code> called <code>subtitleText</code>.</li>
  <li>Add all the gathered information to an <code>SrtSubtitle</code> instance, and append it to <code>QList&lt;SrtSubtitle&gt;</code></li>
  </ul>
  <p>How can I achieve this?</p>