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); 

相关阅读 >>

Delphi xe listbox 行高根据内容高度进行调速

Delphi中如何用image控件显示网络图片

Delphi 实现文件占坑

Delphi 10.3版本获取windows系统版本和cpu信息

Delphi实现文件的拖放功能

Delphi stopprocess 进程关闭函数

Delphi 改造shellexecute 精简函数

Delphi try abort、exit except 、finally end 执行情况

Delphi 控制台 输入输出实例代码

Delphi 图像旋转90° 反旋转90°

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...