title: How to get Last Index Of "%" in a string?
body: <p>How to get Last Index Of "%" in a string in .NET ? 
  I tried </p>
  
  <pre><code>string subString = content.Substring(0, startIndex);
  int nextOpeningComment = subString.LastIndexOf("%", 0);
  </code></pre>
  
  <p><strong>This is always giving me -1.</strong></p>
  
  <p>Here <code>subString</code> I'm getting is:</p>
  
  <pre><code>&lt;div id=\"xyz\"&gt;  \r\n    &lt;img alt=\"\" src=\"App_Themes/Default/Images/abc.jpg\" /&gt;\r\n    &lt;%--
  </code></pre>
  
  <p>Any help/suggestions appreciated.</p>