IntToStr -------------------- Value div 10 Value:=Value mod 10
这是一个字符串提去的hstr:array[0..9]of string;//定义数组temp:='0123456789'for i:=0 to length(temp) do begin hstr[i]:=copy(temp,1,1);//给数组赋值 delete(temp,1,1);//删除赋过的值 end;
var str:string; value:integer; begin value:=12345678; str:=emptystr; while value<>0 do begin str:=inttostr(value mod 10)+str; value:=value div 10; end; showmessage(str); end;
value:=inttostr(1345678); for i:=1 to length(value) do begin j:=copy(value,i,1) end;
var S : String; MYList : TStringLIst; i : integer; begin s:='123456789'; try MYList:=TStringList.Create; For I:=1 to length(s) do begin MyList.add(Copy(s,i,1)); end; Showmessage(MyList.text); finally FreeandNil(MYList); end; end;
function IntToStr(Value: Integer): string; overload; function IntToStr(Value: Int64): string; overload; 得到字符串,也就得到了每一位的数字。
a:array[0..9]of string;//定义数组temp:='0123456789'for i:=0 to length(temp) do begin a[i]:=copy(temp,i,1);//给数组赋值 end;
--------------------
Value div 10
Value:=Value mod 10
begin
hstr[i]:=copy(temp,1,1);//给数组赋值
delete(temp,1,1);//删除赋过的值
end;
str:string;
value:integer;
begin
value:=12345678;
str:=emptystr;
while value<>0 do
begin
str:=inttostr(value mod 10)+str;
value:=value div 10;
end;
showmessage(str);
end;
for i:=1 to length(value) do
begin
j:=copy(value,i,1)
end;
S : String;
MYList : TStringLIst;
i : integer;
begin
s:='123456789';
try
MYList:=TStringList.Create;
For I:=1 to length(s) do
begin
MyList.add(Copy(s,i,1));
end;
Showmessage(MyList.text);
finally
FreeandNil(MYList);
end;
end;
function IntToStr(Value: Int64): string; overload;
得到字符串,也就得到了每一位的数字。
begin
a[i]:=copy(temp,i,1);//给数组赋值
end;
a:stringa:=inttostr(b);
a[0]
.
.
a[length(a)-1]
for i:=1 to length(value) do
begin
j:=copy(value,i,1)
end;就可以了,最简单