指示指定字符串中位于指定位置处的字符是属于十进制数字类别还是属于十六进制数字类别。
public static bool IsNumber(
   string s,
   int index
);
参数

字符串。 
index 
s 中的字符位置。 

解决方案 »

  1.   

    不麻烦,用IsNumber 你看一下帮助
      

  2.   

    在C#中找不到IsNumber与IsDigit?
      

  3.   

    你把字符串用字符表示可以用了
    比如Char.IsDigit(s[0]);
      

  4.   

    不是吧
    System.Char.IsNumber()
    System.Char.IsDigit()
    你查索引帮助
      

  5.   

    谢谢,找到了,但这些都是对char的,像"1234567890"这样的数岂不是要作10次循环?
      

  6.   

    dragontt(龙人)
    你能把这句话写全吗?
      

  7.   

    try
    {
    decimal.parse("string")
    }
    catch
    {
    MessageBox.show("不是数字");
    }
      

  8.   

    Regex re = new Regex("^[0-9]*$");
    re.Split(string);
      

  9.   

    using System.Text.RegularExpressions;
    string ex = "^[0-9]*$";
    Regex reg = new Regex( ex,RegexOptions.IgnoreCase );
    bool flag = reg.IsMatch( 要验证的string );