请教字符串函数
如去除某字符串最左边一个字符,如何写函数?('hello'变成'ello')

解决方案 »

  1.   

    str := Copy('hello', 2, MaxInt);
    --------
    str := 'hello';
    Delete(str, 1, 1);
      

  2.   

    rightstr()是什么函数阿?
    Copy(s,1,Length(s)-1)得到的是'hell'阿?!
      

  3.   

    var
    s:string;
    begin
    s:='hello';
    copy(s,1,length(s)-1);
    //or delete(s,1,1); 
    end;
      

  4.   

    Copy 函数
    Delete 函数
      

  5.   

    我写Delete(str, 1, 1)怎么老提示这个错误阿?!
    "Constant object cannot be passed as var parameter "
      

  6.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      S: string;
    begin
    //  Delete(Caption, 1, 1); //这样是不行的,Caption是属性不是变量~~
      S := Caption;
      Delete(S, 1, 1);
      Caption := S;
    end;
      

  7.   

    uses strutilsrightstr() 这样哟。