本文整理自网络,侵删。
function TrimAnsi(const S: AnsiString): Ansistring;var I, L: Integer;begin L := Length(S); I := 1; while (I <= L) and (S[I] <= ' ') 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 TrimLeftAnsi(const S: AnsiString): AnsiString;var I, L: Integer;begin L := Length(S); I := 1; while (I <= L) and (S[I] <= ' ') do Inc(I); Result := Copy(S, I, Maxint);end;
function TrimRightAnsi(const S: Ansistring): AnsiString;var I: Integer;begin I := Length(S); while (I > 0) and (S[I] <= ' ') do Dec(I); Result := Copy(S, 1, I);end;
相关阅读 >>
Delphi firedac sqlite不能插入"&"符号
Delphi idftp 错误:socket error 10054 �c connection reset by peer -连接被重置
更多相关阅读请进入《Delphi》频道 >>