本文整理自网络,侵删。
function ExtractClassName(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(ExtractClassName('www.delphitop.com')); //结果 delphitopend;
相关阅读 >>
Delphi:取得浏览器地址,网址(支持ie,firefox)
windows关机函数exitwindowsex使用大全(适用windows所有操作平台)
更多相关阅读请进入《Delphi》频道 >>