title: Create sub lists from list of strings based on string starts with
body: <p>Fist time posting, so forgive me on formatting...
  I have a text file that I've read in using File.ReadLines() and stored sequentially to a List.
  I then want to find the first instance of a string that starts with "Student".  Then I want to get all of the strings in the list up to the next instance of a string that starts with "Student" and stop just before it.  Copy those strings to a sub list, and then rinse and repeat until the end of the file is reached.</p>
  
  <p><strong>Example of text file:</strong></p>
  
  <blockquote>
    <p>something on line 1</p>
    
    <p>something on line 2</p>
    
    <p><strong>Student</strong>...: Joe Smith</p>
    
    <p>Id...: 12345</p>
    
    <p>Major...: Math</p>
    
    <p>unknown number of more lines</p>
    
    <p><strong>Student</strong>...: Jane Smith</p>
    
    <p>Id...: 54321</p>
    
    <p>Major...: Nursing</p>
    
    <p>more lines</p>
    
    <p><strong>Student</strong>...: John Doe</p>
    
    <p>Id...: 11223</p>
    
    <p>Major: Anatomy</p>
    
    <p>even more lines.</p>
  </blockquote>
  
  <p>I'd like the list of lines per student to look like this:</p>
  
  <p>Student 1</p>
  
  <blockquote>
    <p>Student...: Joe Smith</p>
    
    <p>Id...: 12345</p>
    
    <p>Major...: Math</p>
    
    <p>unknown number of more lines</p>
  </blockquote>
  
  <p>Student 2</p>
  
  <blockquote>
    <p>Student...: Jane Smith</p>
    
    <p>Id...: 54321</p>
    
    <p>Major...: Nursing</p>
    
    <p>more lines</p>
  </blockquote>
  
  <p>I've used a foreach to iterate the lines.  Each line is added to a new list.  When I find a string that starts with "Student" then I create a new student object and store those lines in the sub list to it.  Then I clear the sublist and then continue on with the foreach, creating new student objects.</p>
  
  <p>Current issues
  I miss the last student.  I know I could have the if statement that checks if the current line starts with "Student" to include checking if the current line is the last line in the list, but I feel there has to be a better/fast way to do this.<br>
  I have to add the &amp;&amp; lines.Count > 3 because there are a few lines before the first instance of "Student" which I want to skip.</p>
  
  <p>Linq examples would be greatly appreciated.</p>
  
  <pre><code>List&lt;Student&gt; students = new List&lt;Student&gt;();
  List&lt;string&gt; lines = File.ReadLines(args[0]).ToList();  
  List&lt;string&gt; student_lines = new List&lt;string&gt;();
  foreach(string line in lines) 
  { 
      if(line.StartsWith("Student...", StringComparison.OrdinalIgnoreCase) &amp;&amp; lines.Count &gt; 3) 
      {
          students.Add(new Student(student_lines)); 
          student_lines.Clear(); 
      } 
      lines.Add(line)
  }
  </code></pre>