收藏 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
}
posted @ 2011-05-23 21:18  一个土豆一棵青菜  阅读(148)  评论(0编辑  收藏  举报