title: How to put list entries that contain "Error" in another list?
body: <p>I am writing a program in visual c# to filter error messages from a .log file and display them. There is a list named "contentList" and there's a list named "errorList"</p>
  
  <pre><code>void BtnCheckLeft_Click(object sender, EventArgs e)
  {
      SearchForErrors(_ContentListLeft);
  }
  
  void BtnCheckRight_Click(object sender, EventArgs e)
  {
      SearchForErrors(_ContentListRight);
  }
  
  void SearchForErrors(List&lt;string&gt; contentList)
  {
      int searchIndex = 1;
      List&lt;string&gt; errorList = new List&lt;string&gt;();
      while(searchIndex != errorList.Count)
      {
          var bla = contentList.BinarySearch("Error");
          searchIndex += 1;
      }
  
      MessageBox.Show("Following errors were spotted:\n\n" + errorList.ToString() + "\n \n \n", "placeholder", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
  }
  </code></pre>
  
  <p>contentList contains every line of the chosen .log file, now I want to put all entries that contain the word error in the list "errorList" and display it. My problem is that the BinarySearch finds nothing, bla (my placeholder var) is constantly -1 and I don't know another way to manage this.
  Maybe you know why the BinarySearch finds nothing or you know another way to display the error lines.</p>