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);
begin
showmessage(ExtractClassName('www.delphitop.com')); //结果 delphitop
end;