title: remove everything before the last occurrence of a character
body: <p>I'm trying to perform the following action on a string : </p>
  
  <ul>
  <li>find the last occurrence of the character <code>"/"</code>;</li>
  <li>remove everything before that character;</li>
  <li>return the remains of the string;</li>
  </ul>
  
  <p>To be more explicit, let's say I have the following string :</p>
  
  <pre><code>var string = "/Roland/index.php"; // Which is a result of window.location.pathname
  </code></pre>
  
  <p>Now what I need to extract out of it is everything but the actual page, something like this :</p>
  
  <pre><code>var result = "index.php" // Which is what I need to be returned
  </code></pre>
  
  <p>Of course, that is just an example, because obviously I will have different pages, but the same principles apply.</p>
  
  <p>I was wondering if someone could help me out with a solution for it. I tried the next actions but with no success :</p>
  
  <pre><code>var location = window.location.pathname;
  var result = location.substring(location.lastIndexOf["/"]);
  </code></pre>