title: C# string.IndexOf() not working properly
body: <p>I am using XML-Like formatted file like: </p>
  
  <pre><code>&lt;Tables&gt;
      &lt;Student&gt;
        ID
        Roll_Number
        Name
      &lt;/Student&gt;
  &lt;/Tables&gt;
  </code></pre>
  
  <p>I have read the file in a string and now for parsing, I want to use string.IndexOf(string) method. It works fine for the closing tags e.g <code>&lt;Student&gt;</code>, <code>&lt;Tables&gt;</code> but it is giving wrong indexes for closing tags e.g <code>&lt;/Tables&gt;</code> or <code>&lt;/Students&gt;</code></p>
  
  <p>Here is my code:</p>
  
  <pre><code>dbFileString.Substring(dbFileString.IndexOf("&lt;Tables&gt;") + "&lt;Tables&gt;".Length, dbFileString.IndexOf("&lt;/Tables&gt;"));
  </code></pre>
  
  <p>Please help.</p>