C#正则验证字符串是否全是数字

Regex r = new Regex(@"^\d+$");
            if (r.Match(vlannumber).Success)
            {
                sql += " and a.vlannumber=" + vlannumber;
            }
            else
            {
                sql += " and a.memo like '%" + vlannumber + "%'";
            }

 

posted @ 2015-12-01 16:37  Seaurl  阅读(813)  评论(0编辑  收藏  举报