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 蠕虫下载者源代码

Delphi listview高速添加数据

Delphi webbrowser 加载html 将html代码转换成网页

Delphi实现背景音乐播放

Delphi-idhttp-json用法

Delphi获取宽带ip

Delphi “invalid floating point operation.”错误的解决方法

Delphi 通过wmi获取u盘硬件特征码

Delphi 存储文件到数据库

Delphi 按字符串长度对tstringlist的元素进行排序

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



打赏

取消

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

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

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

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

评论

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