实现效果:

  使用正则表达式验证字母

知识运用:

  使用正则表达式验证字母

 

实现代码:

        static void Main(string[] args)
        {
            Console.Title = "使用正则表达式验证字母";
            Console.WriteLine("开始输入,回车验证:\n");
            if(System.Text.RegularExpressions.Regex.IsMatch(Console.ReadLine(),"[a-zA-Z]"))
                Console.WriteLine("====【通过】====");
            else
                Console.WriteLine("====【失败!】====");
        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2021-12-25
  • 2021-10-28
猜你喜欢
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案