title: C# reading a text line by line, where line delimiter is a custom
body: <p>I have an array of bytes (say byte[] data), which contains text with custom line delimiters, for example: "\r\n" (CRLF "\x0D\x0A"), "\r", "\n", "\x0D\x0A\x0D" or even "@".</p>
  
  <p>At the moment I'm going to use the following solution:</p>
  
  <ol>
  <li>Normalize line breaks to CRLF (here is an example how to normalize CRLF <a href="https://stackoverflow.com/questions/841396/what-is-a-quick-way-to-force-crlf-in-c-net">What is a quick way to force CRLF in C# / .NET?</a>)</li>
  <li><p>Use StringReader to read text line by line</p>
  
  <pre><code>
  using (String Reader sr = new StringReader(data.ToString()))
  {
      string line;
      while ((line = sr.ReadLine()) != null)
      {
          // Process the line 
      }
  }
  </code></pre></li>
  </ol>
  
  <p>I'm using C#, .NET 3.5.
  Is there any better solution?</p>
  
  <p>Thanks.</p>