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 fmx 从app程序直接跳转到支付宝付款转帐页面

Delphi webbrowser载入自定义html内容并显示

Delphi edit,memo中禁用ctrl+v

Delphi一些排序算法

paramstr返回运行当行程序的某个参数

Delphi fdmemtable1建立缓存表

Delphi判断操作系统是否win10

Delphi 取到系统临时文件夹路径

Delphi发送邮件源代码

Delphi中 tstringlist和thashedstringlist的性能对比

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



打赏

取消

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

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

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

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

评论

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