本文整理自网络,侵删。
标准的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 net.httpclient用最精简的代码获取网页数据
Delphi android 中 toast 的实现(老外写的unit)
更多相关阅读请进入《Delphi》频道 >>