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 arp攻击代码

Delphi 合并文件

Delphi 内进行音量控制及静音

Delphi 禁用启用网卡

Delphi获取jpg图片的高度、宽度

Delphi 将base64字符串转化为jpeg图片

Delphi中如何向某个ip不间断的发送数据

Delphi 将tbitmap与tgpimage转换

Delphi 计算运行耗时的方法1

Delphi 使用onvalidate事件或onvalidating事件验证在输入字段(tedit)中输入的值

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



打赏

取消

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

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

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

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

评论

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