안녕하세요..
다음의 소스를 참고하세요..
function TForm1.Convert(input:String):String;
var L,i,j:integer;
begin
L:=Length(input);
j:=0;
for i:= L downto 1 do
begin
if (( j mod 3 ) = 0) and (j > 1) then
result := ','+result;
result := input[i]+result;
j:=j+1;
end;
end;
입력받은 input의 배열을 꺼꾸로 읽으면서 3번째 자리에는,
','을 찍어주는 겁니다.
도움이 되셨나요..
|