本文整理自网络,侵删。
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);
相关阅读 >>
Delphi webbrowser 加载html 将html代码转换成网页
Delphi “invalid floating point operation.”错误的解决方法
Delphi 按字符串长度对tstringlist的元素进行排序
更多相关阅读请进入《Delphi》频道 >>