strResult : string;
strResult := Format('%020s', ['abc中国']);本来想得到:strResult='0000000000000abc中国';
但是实际上:strResult=' abc中国';
strResult := Format('%020s', ['abc中国']);本来想得到:strResult='0000000000000abc中国';
但是实际上:strResult=' abc中国';
strResult := Format('%1.6d', [123]);
字符串型的就只能补空格了。
http://www.hf110.com/Article/jswz/bcjs/delphi/200504/822.html
function MyFormat(const Format1:String ;const Args:array of const):String;
begin
Result:=StringReplace(Format(Format1,Args),' ','0',[rfReplaceAll]);
end;