方法如下:
import java.net.URL val url = "http://www.fashici.com/tech/217.html" println(new URL(url).getHost)
输出如下:
www.fashici.com
方法如下:
import java.net.URL val url = "http://www.fashici.com/tech/217.html" println(new URL(url).getHost)
输出如下:
www.fashici.com