判断字符还是数字的方法。
using System;
using System.Text.RegularExpressions;
using System.Collections;
public class MyClass
{
public static void Main()
{
string aa = "11";
if(Regex.Replace(aa,@"\d*","",RegexOptions.None).Length == 0)
{
Console.WriteLine("Numeric");
}
aa = "adfadsf哈哈哈";
if(Regex.Replace(aa,@"\D*","",RegexOptions.None).Length == 0)
{
Console.WriteLine("Char");
}
Console.Read();
}
}
-----------------------------------
http://www.cnblogs.com/rock_chen/