📅  最后修改于: 2022-03-11 14:52:20.039000             🧑  作者: Mango
public static String getDomainName(String url) throws URISyntaxException {
URI uri = new URI(url);
String domain = uri.getHost();
return domain.startsWith("www.") ? domain.substring(4) : domain;
}