title: c# search string in txt file
body: <p>I want to find a string in a txt file if string compares, it should go on reading lines till another string which I'm using as parameter.</p>
  <p>Example:</p>
  <pre class="lang-none prettyprint-override"><code>CustomerEN //search for this string
  ...
  some text which has details about the customer
  id &quot;123456&quot;
  username &quot;rootuser&quot;
  ...
  CustomerCh //get text till this string
  </code></pre>
  <p>I need the details to work with them otherwise.</p>
  <p>I'm using linq to search for &quot;CustomerEN&quot; like this:</p>
  <pre><code>File.ReadLines(pathToTextFile).Any(line =&gt; line.Contains(&quot;CustomerEN&quot;))
  </code></pre>
  <p>But now I'm stuck with reading lines (data) till &quot;CustomerCh&quot; to extract details.</p>