Hi Allan, have you taken a look at the docs I linked to? You can pass additionally arguments to lastIndexOf
to "walk" backwards from one slash to the slash preceding it. Then you can continue to pass these indices to substring
to extract out the different parts of the URL. Though you might want to consider Christian's suggestion if you're planning on building a long-term (i.e. scalable) solution.
Thanks,
CJ