public static bool isnumber(string s)
{
if (string.IsNullOrWhiteSpace(s)) return false;
if (s.Substring(0,1) == "0") return false;
const string pattern = "^[0-9]*$";
Regex rx = new Regex(pattern);
return rx.IsMatch(s);
}

posted on 2019-03-05 15:29  文龙再现  阅读(136)  评论(0编辑  收藏  举报