title: How can I find a word in a C# string
body: <p>I need to load a long string from the internet and I have done that. Now I need to find the <code>H1</code> header tag and print the contents. </p>
  
  <p>What is the shortest or the easiest way to do that?</p>
  
  <pre><code>for (int x = 0; x &lt; tempString.Length; x++)
  {
  
      if (write == 2)
      {
          name =name + tempString[x];
          lenght++;
      }
      if (tempString[x] == '&lt;' &amp;&amp; tempString[x] == 'h' &amp;&amp; tempString[x] == '1' )
          write = 1;
  
      if (write == 1 &amp;&amp; tempString[x] == '&gt;')
          write = 2;
  
      if (tempString[x] == '-' &amp;&amp; write == 1)
          write = 0;
  }
  </code></pre>
  
  <p>I know it's a bit how shall I say odd. But it's all I have.</p>