title: How to return part of string before a certain character?
body: <p>If you look at the <a href="http://jsfiddle.net/nick_craver/jEQQg/" rel="noreferrer">jsfiddle</a> from <a href="https://stackoverflow.com/questions/4092325/how-to-remove-part-of-a-string-before-a-in-javascript">question</a>,</p>
  
  <pre><code>var str = "Abc: Lorem ipsum sit amet";
  str = str.substring(str.indexOf(":") + 1);
  </code></pre>
  
  <p>This returns all characters after the <code>:</code>, how can I adjust this to return all the characters before the <code>:</code></p>
  
  <p>something like
  <code>var str_sub = str.substr(str.lastIndexOf(":")+1);</code> but this does not work.</p>