public bool Isnum(string str)
{
const string pattern = "^[0-9]*$";
Regex rx = new Regex(pattern);
return rx.IsMatch(str); //bool类型
}
分享个正则表达式判断字符串是否为数字
最新推荐文章于 2024-07-23 17:34:53 发布
关键词由CSDN通过智能技术生成