delphi 网址链接提取域名


本文整理自网络,侵删。

 
//20180307 改进
function DelHttp(URL: String): String;
begin
  if Pos('http://', URL) > 0 then Delete(Url, 1, 7);
  Result := Copy(Url, 1, Pos('/', Url) - 1);

  if Pos('https://', URL) > 0 then Delete(Url, 1, 8);
  Result := Copy(Url, 1, Pos('/', Url) - 1);

  if Result = '' then Result := URL;
end;


memo1.Lines.Add(DelHttp(edit1.Text)); //http://www.baidu.com/1/2/3/4/   转换结果 www.baidu.com

相关阅读 >>

Delphi 用注册表对Delphi程序进行验证

Delphi firedac 下的 sqlite [7] - 备份、优化、事务(transaction)

Delphi-基础(for循环)

Delphi 2009 泛型容器单元(generics.collections)[2]: tqueue<t>

Delphi10.3读取json数据

Delphi用mapfileandchecksum 函数检测 exe 或 dll 是否被修改

Delphi tedit 编辑框 中文使用说明

Delphi 代码查询一个 ip 地址的归属地

fmsoft_unigui个文件说明

Delphi 限制form窗体为固定的大小

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...