title: String array throws OutOfMemoryException for large multi-line entries
body: <p>In a Windows Forms C# app, I have a textbox where users paste log data, and it sorts it. I need to check each line individualy so I split the input by the new line, but if there are a lot of lines, greater than 100,000 or so, it throws a OutOfMemoryException.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>StringSplitOptions splitOptions = new StringSplitOptions();
  if(removeEmptyLines_CB.Checked)
      splitOptions = StringSplitOptions.RemoveEmptyEntries;
  else
      splitOptions = StringSplitOptions.None;
  
  List&lt;string&gt; outputLines = new List&lt;string&gt;();
  
  foreach(string line in input_TB.Text.Split(new string[] { "\r\n", "\n" }, splitOptions))
  {
      if(line.Contains(inputCompare_TB.Text))
          outputLines.Add(line);
  }
  output_TB.Text = string.Join(Environment.NewLine, outputLines);
  </code></pre>
  
  <p>The problem comes from when I split the textbox text by line, here <code>input_TB.Text.Split(new string[] { "\r\n", "\n" }</code></p>
  
  <p>Is there a better way to do this? I've thought about taking the first X amount of text, truncating at a new line and repeat until everything has been read, but this seems tedious. Or is there a way to allocate more memory for it?</p>
  
  <p>Thanks,
  Garrett</p>
  
  <p><strong>Update</strong></p>
  
  <p>Thanks to Attila, I came up with this and it seems to work. Thanks</p>
  
  <pre><code>StringReader reader = new StringReader(input_TB.Text);
  string line;
  while((line = reader.ReadLine()) != null)
  {
      if(line.Contains(inputCompare_TB.Text))
          outputLines.Add(line);
  }
  output_TB.Text = string.Join(Environment.NewLine, outputLines);
  </code></pre>