title: How to get the line of specific text in richTextBox?
body: <p>I have a richTextbox which some texts inside. Currently, the "orange" is located in the line 3....so how can i get the line of "orange". My code doesn't work =(</p>
  
  <p><img src="https://i.stack.imgur.com/ZuvsE.jpg" alt="enter image description here"></p>
  
  <p>My C# code:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          string orange = "orange";
          int a = richTextBox1.Text.IndexOf(orange);
          var b = richTextBox1.Lines.ElementAt(a);
  
          textBox1.Text = b.ToString();
  
      }
  </code></pre>