本文整理自网络,侵删。
function ExtractIP(const S: String): String;var I, L, K1, K2: Integer; ip:string;beginip:=S+'.'; L := Length(ip);
result := '';
K1 := 0; K2 := 0;
for I:= L downto 1 do //www.delphitop.com 原创 随便转载 if ip[I] = '.' then if K2 = 0 then K2 := I else begin K1 := I; result := Copy(ip, K1 + 1, K2 - K1 - 1); Exit; end; result := Copy(ip, K1 + 1, K2 - K1 - 1);end;
相关阅读 >>
Delphi unigui中如何监听session的开始与结束
Delphi firemonkey移动应用程序将设置保存到ini文件的示例
更多相关阅读请进入《Delphi》频道 >>