本人在写程序时,遇有这个isNumeric,请大家帮忙指点一下!
本人不生感激!

解决方案 »

  1.   

    有点晕.Delphi提供这个函数吗?
      

  2.   

    DELPHI的帮助:
    /*************
    要USE  IdGlobal 单元
    Determines if a character is a numeric digit.
    function IsNumeric(c: char): Boolean;Parametersc: charCharacter to be examined.
    ReturnsBoolean - True if the character is a numeric digit.
    DescriptionIsNumeric is a Boolean function that indicates if the character in c contains a numeric digit in the range '0'..'9'.
      

  3.   

    判断单个字符是否是数字型的字符
      
      if IsNumeric('4') then
         showmessage('Yes')
      else  
         showmessage('No');  
      

  4.   

    var
      I: Integer;
    begin
      if TryStrToInt('123', I) then
        { TODO }
    end;
      

  5.   

    //判断是否是整数
    public static boolean isNumeric(String s)
    {
    if((s != null)&&(s!=""))
    return s.matches("^[0-9]*$");
    else
    return false;
    }
      

  6.   

    如果需要判断是否数字:
            public static boolean isFloat(String s){
                    if((s != null) && !s.equals(""))
                            return s.matches("^[0-9]+[\\.]?[0-9]*$");
                    else
                            return false;                
            }
      

  7.   

    不好意思,忘记这是在delphi版了,这是java的,delphi没有正则表达式么?