Okay I have this
var URL = \"http://stackoverflow.com/questions/10767815/remove-everything-before-the-last-occurrence-of-a-character\"; console.log(URL.subst
Here you are:
var URL = "http://stackoverflow.com/questions/10767815/remove-everything-before-the-last-occurrence-of-a-character"; alert(URL.substring(0, URL.lastIndexOf("/") + 1));
Hope this helps.