title: Filtering a line out of a string c#
body: <p>I want to read a .txt file in c# and filter a line out of the string and only show that line. If the match is on the first line, i get a good output using streamreader.ReadLine. But if it's on the second line, i need to get it filtered. (i tought by creating a ReadLine loop?)
  Thanks in advance</p>
  
  <pre><code>        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
      {
  
          StreamReader sr = new StreamReader(textBox1.Text);
          string BoxLM1 = sr.ReadLine();
  
          if (comboBox3.Text == "Anderlecht")
          {
              if (BoxLM1.Contains("Anderlecht"))
              {
              label5.Text = BoxLM1;
              }
  
              else
              {
                  string BoxLM2 = sr.ReadToEnd();
  
  
  
                      MessageBox.Show(BoxLM2);  
  
              }
  </code></pre>