本文整理自网络,侵删。
//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 firedac 下的 sqlite [7] - 备份、优化、事务(transaction)
Delphi 2009 泛型容器单元(generics.collections)[2]: tqueue<t>
Delphi用mapfileandchecksum 函数检测 exe 或 dll 是否被修改
更多相关阅读请进入《Delphi》频道 >>