title: How to get the index of the last occurence of a char in PowerShell string?
body: <p>I want to get the index of the last "\" occurrence in order to trim the "Activity" word and keep it, from following string in PowerShell:</p>
  
  <pre><code>$string = "C:\cmb_Trops\TAX\Auto\Activity"
  </code></pre>
  
  <p>I'm converting the code from VBScript to PowerShell and in VB there's this solution :</p>
  
  <pre><code>Right(string, Len(string) - InStrRev(string, "\"))
  </code></pre>
  
  <p>Using Right and InStrRev functions which makes the life more easier. Unfortunately I didn't find anything like it in PowerShell. Can't find any option to scan from the end of the string.</p>