代码改变世界

C#判断输入的字符串中是否含有大写字母,小写字母,数字,字符

2010-03-22 20:39  观海看云  阅读(3231)  评论(0编辑  收藏  举报

System.Text.RegularExpressions.Regex.IsMatch(argValue, "[A-Z]")
System.Text.RegularExpressions.Regex.IsMatch(argValue, "[0-9]")
System.Text.RegularExpressions.Regex.IsMatch(argValue, "[a-z]")
System.Text.RegularExpressions.Regex.IsMatch(argValue, "[\u0000-\u00FF]")

返回True:有匹配项;False:没有匹配项