请教关于字符串的操作
--------------------------------------------------------
任意长度字符串str1怎样得到新字符串str2为str1前加字母'A',后加'b'?又如何返回str1?

解决方案 »

  1.   

    functiong test(const str1: string): string;
    begin
      result := 'A' + str1 + 'b';
    end;你str1返回什么?
      

  2.   

    有const 报错
    没有const 没有返回值
    -----------------------------------------
    function concatstr(str:string):string;
    begin
      str:='Aaa'+str+'aa';
    end;procedure TForm1.Btn_1Click(Sender: TObject);
    begin
      Edit_2.Text:=concatstr(Edit_1.Text);
    end;
    ---------------------------------------
    上面代码没有返回值或返回值为空
    怎么回事?
      

  3.   

    function concatstr(str:string):string;
    begin
      result:='Aaa'+str+'aa';
    end;返回用result
      

  4.   

    有const 报错
    没有const 没有返回值
    ----------------
    代码手写的,笔误
    functiong 改成function
      

  5.   

    1楼的把function 该对就是正确答案
      

  6.   

    function test1(const str1: string): string;
    begin
      result := 'A' + str1 + 'b';
    end;