var Idx: Integer; Str: String; Arr: array of WideString; Len: Integer; begin Len := 0; Str := 'I我LOVE爱YOU你'; for Idx := 0 to Length(WideString(Str)) do begin if Ord(WideString(Str)[Idx]) >= $1000 then begin Inc(Len); SetLength(Arr, Len); Arr[Pred(Len)] := WideString(Str)[Idx]; end; end; end;
var str:string; arr:array[0..6] of string; I,J:integer; begin str:='我真的好喜欢你'; J:=1; for I := 0 to 6 do begin arr[I]:=str[J]+str[J+1]; inc(J,2); end; for I:=0 to 6 do //edit1.Text:=edit1.Text+arr[I]; end;
var f,g:string; i,j,k:integer; begin g:='喜欢你'; j:=length(g); for i:=1 to j do begin if (i mod 2 <> 0 ) then begin f:=midstr(g,i,2); showmessage(f); //showmessage(inttostr(i)); end; end; end;扼 我自己也想了一个出来 又学到了 哈哈 每人25分吧
Idx: Integer;
Str: String;
Arr: array of WideString;
Len: Integer;
begin
Len := 0;
Str := 'I我LOVE爱YOU你';
for Idx := 0 to Length(WideString(Str)) do
begin
if Ord(WideString(Str)[Idx]) >= $1000 then
begin
Inc(Len);
SetLength(Arr, Len);
Arr[Pred(Len)] := WideString(Str)[Idx];
end;
end;
end;
str:string;
arr:array[0..6] of string;
I,J:integer;
begin
str:='我真的好喜欢你';
J:=1;
for I := 0 to 6 do
begin
arr[I]:=str[J]+str[J+1];
inc(J,2);
end;
for I:=0 to 6 do
//edit1.Text:=edit1.Text+arr[I];
end;
f,g:string;
i,j,k:integer;
begin
g:='喜欢你';
j:=length(g);
for i:=1 to j do
begin
if (i mod 2 <> 0 ) then
begin
f:=midstr(g,i,2);
showmessage(f);
//showmessage(inttostr(i));
end;
end;
end;扼 我自己也想了一个出来 又学到了
哈哈 每人25分吧