用copy就行了,具体用法查帮助就行了。

解决方案 »

  1.   

    李三[email protected]
    这个本身就有问题,如果email是数字开头的怎么区分?
      

  2.   

    function ZsGoto(mStr: string; mSysCharSet: TSysCharSet): string;
    var
      I: Integer;
    begin
      Result := '';
      for I := 1 to Length(mStr) do begin
        if mStr[I] in mSysCharSet then Break;
        Result := Result + mStr[I];
      end;
    end; { ZsGoto }function ZsTogo(mStr: string; mSysCharSet: TSysCharSet): string;
    var
      I: Integer;
    begin
      Result := '';
      for I := 1 to Length(mStr) do
        if mStr[I] in mSysCharSet then begin
          Result := Copy(mStr, I, MaxInt);
          Break;
        end;
    end; { ZsTogo }procedure TForm1.Button1Click(Sender: TObject);
    var
      S: string;
    begin
      S := '李三[email protected]';
      Memo1.Clear;
      Memo1.Lines.Add(ZsGoto(S, ['0'..'9']));
      S := ZsTogo(S, ['0'..'9']);
      Memo1.Lines.Add(ZsGoto(S, ['a'..'z', 'A'..'Z']));
      S := ZsTogo(S, ['a'..'z', 'A'..'Z']);
      Memo1.Lines.Add(S);
    end;