Firstly, I am aware that there are other posts similar, but since mine is using a URL and I am not always sure what my delimiter will be, I feel that I am alright posting my
Instead of url.split(".org"); try url.split("/"); and iterate through your array of strings.
url.split(".org");
url.split("/");
Or you can look into regular expressions. This is a good example to start with.
Good luck on your homework.