本文整理自网络,侵删。
function ExtractURLName(const S: String): String;var I, L, K1, K2: Integer;begin L := Length(S);
result := '';
K1 := 0; K2 := 0;
for I:= L downto 1 do if S[I] = '/' then if K2 = 0 then K2 := I else begin K1 := I; result := Copy(S, K1 + 1, K2 - K1 - 1); Exit; end; result := Copy(S, K1 + 1, K2 - K1 - 1);end;
procedure TForm1.FormCreate(Sender: TObject);beginshowmessage(ExtractURLName('http://www.delphitop.com/html/zifuchuan/')); //结果 zifuchuanend;
相关阅读 >>
Delphi windows 底下根据一个进程的名字杀死一个进程的代码
d10环境下调用hidcontroller1.0.35获取数据乱码问题
Delphi 动态给combobox赋值,从combobox中取值
更多相关阅读请进入《Delphi》频道 >>