检测输入是不是数字

private bool CheckNumber(string number)
{
Regex regex = new Regex(@"^(-)?d+(.d+)?$");
if (regex.IsMatch(number))
{
return true;
}
else
{
return false;
}
}

原文地址:https://www.cnblogs.com/mibing/p/7338114.html