title: How to get the last index of a string value
body: <p>Below is the code:</p>
  <pre><code>PropertyInfo[] requestPropertyInfo;
  requestPropertyInfo = typeof(CBNotesInqAndMaintRequest).GetProperties();
  </code></pre>
  <p>The CBNotesInqAndMaintRequest contains request data member noteline1---noteline18. once I read the name of one of the data member, I want to get its last index. For eg. If the name of the request object is &quot;noteline8&quot;, I want to get the index as 8.</p>
  <p>For this I have written the below code:</p>
  <pre><code>foreach (PropertyInfo reqPropertyInfo in requestPropertyInfo)
  {
    index = reqPropertyInfo.Name.LastIndexOf(&quot;noteline&quot;);
  }
  </code></pre>
  <p>But the above code is returning the index as 0.</p>