title: How to get search result from the original string after searching with C#
body: <p>What I've tried here is I can show the file path that contents the string in the <code>Textbox1.Text</code> but I cannot get and show the string in that file.</p>
  
  <pre><code>private void Search_Click(object sender, EventArgs e)
  {
      string[] filePaths = Directory.GetFiles(@"C:\Users\abcdq\Downloads\Documents\", "*.pdf", SearchOption.AllDirectories);
      for (int i = 0; i &lt; filePaths.Length; i++)
      {
          string settext = GetTextFromPDF(filePaths[i]);
          if (settext.ToUpper().Contains(textBox1.Text.ToUpper()))
          {
              MessageBox.Show(filePaths[i]);
          }
      }
  }
  </code></pre>
  
  <p>For example: In the account.pdf, it has:</p>
  
  <blockquote>
    <p>New users? For new users, you will need to fill in the form to the
    right of the page with the following information: Support Reference –
    This is your support contract number with us e.g. DM1234 or RH1234.
    Company Name – This needs to be the exact name we know you as to match
    your support reference. Display Name – Your name, this will
    automatically be filled in when you use some of the forms in the site.
    Email &amp; Email confirm – Your email address, this will become your
    username. Password – A password consisting of at least 6 characters
    (letters, numbers, and symbols).</p>
  </blockquote>
  
  <ol>
  <li>When I search <code>email confirm</code> the result must be return to me the string as <code>Email confirm</code> not as <code>email confirm</code>.</li>
  <li>More than that, I am looking for the way to return the string has more some characters in left and right side that string as <code>Email &amp; Email confirm – Your email address</code>.</li>
  </ol>