我试图从URL字符串中提取域名.我几乎拥有它......我正在使用URI
我有一个字符串..我的第一个想法是使用正则表达式,但后来我决定使用URI类
我需要将上面的内容转换为google.com和google而不使用www
我做了以下
Uri test = new Uri(referrer);
log.Info("Domain part : " + test.Host);
Run Code Online (Sandbox Code Playgroud)
基本上这会返回www.google.com ....如果可能的话,我想尝试返回2个表单......如上所述...
google.com和谷歌
这有可能与URI?