用正则判断字符串是否为数字

 System.Text.RegularExpressions.Regex

rex =  new System.Text.RegularExpressions.Regex(@"^\d+$");


 if (rex.IsMatch(intChar))

{

return Convert.ToInt32(intChar); 

posted on 2010-03-19 15:45  编程烂指  阅读(166)  评论(0编辑  收藏  举报

导航