作者:admin 来源: 日期:2020/11/27 20:16:28 人气: 标签:
标准的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;