- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi PADL 处理字符串的函数
function PADL(Src: string; Lg: Integer): string;
begin
Result := Src;
while Length(Result) < Lg do
Result := ' ' + Result;
end;
function PADR(Src: string; Lg: Integer): string;
begin
Result := Src;
while Length(Result) < Lg do
Result := Result + ' ';
end;
function PADC(Src: string; Lg: Integer): string;
begin
Result := Src;
while Length(Result) < Lg do
begin
Result := Result + ' ';
if Length(Result) < Lg then
begin
Result := ' ' + Result;
end;
end;
end;
S := PADL(S,32);