BMS-HOSxP Community
HOSxP => Delphi / Pascal => ข้อความที่เริ่มโดย: doramon ที่ พฤษภาคม 08, 2009, 17:44:46 PM
-
ฟังชันนี้สามารถเติม 0 หน้าหรือหลังก็ได้ กำหนดความยาวข้อความได้ด้วย
st=insZero('9',1,4);
function InsZero(Str:string;Pos:integer;No:integer):string;
begin
//
while length(str)<No do
begin
insert('0',str,pos);
end;
result:=str;
end;