怎样把大写的“一,二,三”之类的,转换成阿拉伯数字1,2,3?

解决方案 »

  1.   

    function tosum(str:string):integer;
    begin
      if str='一' then result:=1;
      ..................
    end;
      

  2.   

    songhtao(三十年孤独) 怎么能犯这错误,
    case 必须是有序数据类型,"一二三四"这类的是字符串,不能用在case中的
      

  3.   

    呵呵,只能一串if了,如果是VB就连string都可以case  ...
      

  4.   

    var
       intNo: Integer;
       wstrValue: WideString;
    begin
       wstrValue := '一二三四';
       for intNo := 1 to Length(wstrValue) do
       begin
          case wstrValue[intNo] of
             WideChar('一'):
             WideChar('二'):
             WideChar('三'):
             WideChar('四'):
          end;
          // ??? ... ...
       end;
    end;当然可以使用 case 作为判断语句.
      

  5.   

    kyee(浪子阿鹏) 的方法不错,呵呵没想到   @_@