Nov 24

The URL class can be used to parse a URL and retrieve the components such as host name

String urlstring = "http://www.objects.com.au/services/sherpa.html"
URL url = new URL(urlstring};
String host = url.getHost();   // returns "www.objects.com.au"

written by objects \\ tags: , ,