Okay I have this
var URL = \"http://stackoverflow.com/questions/10767815/remove-everything-before-the-last-occurrence-of-a-character\"; console.log(URL.subst
var URL = "http://stackoverflow.com/questions/10767815/remove-everything-before-the-last-occurrence-of-a-character"; console.log(URL.substring(0,URL.lastIndexOf('/')+1)); //The +1 is to add the last slash