本文整理自网络,侵删。
标准的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 webbrowser控件实现对ie浏览器的各种控制
更多相关阅读请进入《Delphi》频道 >>