Let\'s say I have a URL:
http://something.com/somethingheretoo
and I want to get what\'s after the 3rd instance of /?
/
s = 'http://something.com/somethingheretoo'; parts = s.split('/'); parts = parts.slice(0, 2); return parts.join('/');
In your case, you could use the lastIndexOf() method to get the 3rd forward slash.
lastIndexOf()