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;

相关阅读 >>

Delphi 利用google api生成二维码图像

Delphi 根据注册表信息判断程序是否安装

Delphi unix时间转换成Delphi时间

Delphi处理http请求自定义header

Delphi中设置条件断点

Delphi datetimepicker控件日期格式

Delphi webbrowser控件实现对ie浏览器的各种控制

Delphi编写的一款锁屏小工具

Delphi 文件占坑法过360查杀

Delphi unigui form控件跳转

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



打赏

取消

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

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

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

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

评论

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