比如有一字符串 
s:=‘真的好喜欢你’;
现在要把他分成
array  f[0]:=‘真’;
       f[1]:='的 ';
       ...........
       f[5]:='你';
能写出详细的过程吗 有分的哦

解决方案 »

  1.   

    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;
      

  2.   

    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;
      

  3.   

    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分吧