实现效果:

  使用正则验证输入大写字母

知识运用:

  使用正则验证输入大写字母

实现代码:

        static void Main(string[] args)
        {
            Console.Title = "使用正则验证输入大写字母:";
            Console.SetWindowSize(55,10);
            if(System.Text.RegularExpressions.Regex.IsMatch(Console.ReadLine(),"^[A-Z]+$"))
                Console.WriteLine("通过");
            else
                Console.WriteLine("错误");
        }

 

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案