zoukankan      html  css  js  c++  java
  • 如果输入的不是英文字母或者数字或者汉字,则返回false

     public partial class Form1 : Form 

    •     { 
    •         public Form1() 
    •         { 
    •             InitializeComponent(); 
    •         } 
    •  
    •         private void button1_Click(object sender, EventArgs e) 
    •         { 
    •             string input = textBox1.Text.Trim(); 
    •             if (chkInput(input)) 
    •                 MessageBox.Show("true"); 
    •             else 
    •                 MessageBox.Show("false"); 
    •         } 
    •  
    •         /// <summary> 
    •         /// 如果输入的不是英文字母或者数字或者汉字,则返回false 
    •         /// </summary> 
    •         /// <returns></returns> 
    •         private bool chkInput(string input) 
    •         { 
    •             Regex regex = new Regex(@"^[u4E00-u9FFFA-Za-z0-9]+$"); 
    •             return regex.IsMatch(input); 
    •         } 
    •     } 
  • 相关阅读:
    hgoi#20191101
    hgoi#20191031
    hgoi#20191030
    hgoi#20191029-2
    RMQ (Range Minimum/Maximum Query)
    数学浅谈-组合数与数学期望
    重庆NK十日行-知识点汇总
    分块
    STL—algorithm与Map容器
    搜索—迭代加深
  • 原文地址:https://www.cnblogs.com/DTWolf/p/4660802.html
Copyright © 2011-2022 走看看