用copy:-->copy(str,1,4)  //从str中第一个字符起,取出4个字符
或pos:-->pos(substr,str)

解决方案 »

  1.   

    To yxjjx
    您怎么知道s1是四个字符长哪?
      

  2.   

    一个字符一个字符地判断,遇到加号则取出部分,jAdd到一个StringList
      

  3.   

    建议你用pos吧。
    看看delphi的例子。
    你会受益。
      

  4.   

    你看合不合你的要求
    procedure TForm1.Button1Click(Sender: TObject);
    var aa:string;
        bb:string;
        i,j:integer;
    begin
     aa:='aaaa+bbbb+cccc+dddd';
     j:=1;
     for i:=1 to length(aa) do
       begin
         if aa[i]='+'then
           begin
             bb:=copy(aa,j,i-j);
             showmessage(bb);
             j:=i+1;
           end
       else  if i=length(aa) then
           begin
             bb:=copy(aa,j,i-j+1);
             showmessage(bb);
           end;
       end;
    end;