java
import java.net.URL;
public class GetDomainName {
public static void main(String[] args) {
try {
URL url = new URL("e.com/path/to/resource");
String domain = url.getHost();
System.out.println("Domain: " + domain);
} catch (Exception e) {
e.printStackTrace();
}
}
}
顶一下
(0)
0%
踩一下
(0)
0%
- 相关评论
- 我要评论
-