runliuv

runliuv@cnblogs

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

FROM :   https://www.cnblogs.com/ilookbo/p/4828722.html

 

/// <summary>
       /// 判断输入的字符串是否只包含数字和英文字母
       /// </summary>
       /// <param name="input"></param>
       /// <returns></returns>
       public static bool IsNumAndEnCh(string input)
       {
           string pattern = @"^[A-Za-z0-9]+$";
           Regex regex = new Regex(pattern);
           return regex.IsMatch(input);
       }

 

posted on 2019-04-30 16:22  runliuv  阅读(538)  评论(0编辑  收藏  举报