Str_leftChar:=RightStr(Str_leftChar,1)取不出中文,
我的Str_leftChar是Wildstring类型,其中有中文有英文,不管是中文还是英文
我想取出最后一个字符

解决方案 »

  1.   

    s:=edit1.Text;
      if ord(s[length(s)])>128 then//是否汉字
        edit1.Text:=copy(edit1.Text,length(edit1.text)-1,2)
      else
        edit1.Text:=copy(edit1.Text,length(edit1.text),1);
      

  2.   

    Copy(Str_LeftChar,Length(Str_LeftChar) - 1 ,1) ;
      

  3.   

    抱歉,错了Copy(Str_LeftChar,Length(Str_LeftChar) ,1) ;
      

  4.   

    var   Str_LeftChar : WideString ;
      

  5.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      tmp1,tmp2:WideString;
    begin
      tmp1:='hello我';
      tmp2:='hellowo';
      showmessage(rightstr(tmp1,1));
      showmessage(rightstr(tmp2,1));
    end;
      

  6.   

    同意:wjlsmail(计算机质子) 的方法!