收藏 c#小函数

using System.Text.RegularExpressions;

private const string ZZValidInt4 = @”^[0-9]*[1-9][0-9]*$”;

//temp是string类型

if (Regex.IsMatch(temp, ZZValidInt4) == false)

{
//no int
//dosomeing

}else
{
//is int
//dosomeing
}
原文地址:https://www.cnblogs.com/0banana0/p/2054740.html