给你一个函数
type sDirection=(s_Left,s_Right,s_Up,s_Down);
function FillStr(sStr, fStr: string; i: integer;sides:sDirection): String;
begin
if sides=s_Left then //若为s_Left﹐从左填起
begin
while Length(sStr)<i do
sStr:=fStr+sStr;
Result:=sStr;
end
else
begin
while Length(sStr)<i do
sStr:=sStr+fStr;
Result:=sStr;
end;
end;
例﹕FillStr('128','0',12',s_Left)='000000000128';
自己可以根据需要自己改此函数