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 2010/xe下隐藏程序在系统任务栏的图标

Delphi antiemupeb

Delphi 取控件下的图象

Delphi中窗体的事件

Delphi tlistview控件里添加背景色

Delphi dbgrid鼠标滚屏

Delphi 定时鼠标模拟点击

Delphi xe8中的firemonkey应用程序将文本复制到剪贴板

Delphi用代码实现注册ocx和dll

Delphi 保存hotkey1.hotkey值

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



打赏

取消

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

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

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

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

评论

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