public static bool IsNumeric(string str)
{
Regex regex1 = new Regex(@"^[+]?\d*$");
return regex1.IsMatch(str);
}这个正则如果 输入的参数 str 为空返回的布尔值也是 true请求修改下,使之输入参数 str未空 时候,返回布尔值未false;
等价于
public static bool IsNumeric(string str)
{
                           if str=="" return false;
Regex regex1 = new Regex(@"^[+]?\d*$");
return regex1.IsMatch(str);
}