Delphi 为数字补充前缀0


本文整理自网络,侵删。

 
标准的Format函数可以做同样的事情!
Format('%。10d',[15])将返回'0000000015'

或者:
function AddLeadingZeros(const Source: string; Len: Integer): string;
var
  i: Integer;
begin
  Result := Source;
  for i := 1 to (Len-Length(Source)) do
    Result := '0' + Result;
end;

相关阅读 >>

Delphixe4 版本中,已针对移动平台 引入了 arc 模型

Delphi获取系统进程和路径

怎样在Delphi中屏蔽flash控件的右键弹出菜单

Delphi 判断指定字符串是否开头 startstext用法

Delphi memo1 字符串快速查找定位2

Delphi 带参数的 exit

Delphi中生成控件的两种方法

Delphi xe6 for android 让手机震动

Delphi中从dll,exe,icl中提取图标

Delphi 下保存真彩彩图标的方法实例

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



打赏

取消

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

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

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

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

评论

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