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 实现qq窗体的缩入伸出功能

Delphi调节图片亮度、色彩和饱和度的代码

Delphi 写变速齿轮外挂

Delphi

Delphi 检测应用程序是否已停止响应

Delphi 获取当前目录下所有文件名3

Delphi自动以管理员身份在vista 和 windows7 下运行程序

Delphi getfilehashmd5

Delphi nethttpclient1 数据库查询

Delphi 2009 之 tstringbuilder 类[7]: tostring

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



打赏

取消

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

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

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

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

评论

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