title: Remove Part After Last Occurrence of a Word Pattern in a String
body: <p>I have this code:</p>
  
  <pre><code>var str = 'country/city/area'
  var idx = str.lastIndexOf('country/city')
  // idx = 0
  </code></pre>
  
  <p>And <em>idx</em> is always 0. Shouldn't <em>idx</em> be 12? My goal is to use it substr() in order to take the string <em>'area'</em> out of the <em>str</em>.</p>