to cat.yy:你还用这么老的delphi版本吗?
我给你一个函数,自己看吧:
function Trim(const S: string): string;
var
I, L: Integer;
begin
L := Length(S);
I := 1;
while (I <= L) and (S <= ' ') do Inc(I);
if I > L then Result := '' else
begin
while S[L] <= ' ' do Dec(L);
Result := Copy(S, I, L - I + 1);
end;
end;
function TrimAll(const S: string): string;
var
I, L: Integer;
Buffmsg: String;
begin
L := Length(S);
I := 1;
while (I <= L) do
begin
if S <> ' ' then Buffmsg := Buffmsg + S;
Inc(I);
end;
Result := Buffmsg;
end;