I have a url string and I'd like to get the host out of it.
Now, I know I can just do:
URL url = new URL("http:///whatever.com/whatever?whatever=whatever
String host = url.getHost();
But must I really instatiate a URL every time? Is there some kind of a static utility class that would do this without the need to do "new URL" ? For the purposes of this question, assume that I don't want to be manually parsing the string using a regex or a substring.