I need to convert a list of URLS to their host name. SO tried the below mentioned code:
URL netUrl = new URL(url);
String host = netUrl.getHost();
The above mentioned code is producing output as shown below:
a95-101-128-242.deploy.akamaitechnologies.com
a23-1-242-192.deploy.static.akamaitechnologies.com
edge-video-shv-01-lht6.fbcdn.net
I want only the website name from the above output like as shown below:
akamaitechnologies
akamaitechnologies
fbcdn
Please someone help. Thanks