I currently have a url path like so:
var str = "http://stackoverflow.com/i-like-upvotes/you-do-too";
I wish to delete/remove all the string up to the last /
slash.
If I wanted to replace the last slash I'd get it like this:
console.log(str.replace(/\/(?=[^\/]*$)/, '#'));
But I would like to delete everything up to the last slash and I can't figure it out. In the above example I'd get back
you-do-too
Any ideas?