摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 集合 7 { 8 class Student 9 { 10 //学生id 11 private int sid; 12 13 public int Sid 14 { 15 get { return sid; } 16 set { s... 阅读全文
posted @ 2013-10-24 10:42 豆豆0829 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 正则表达式元字符 元字符1). 除\n外的任何字符a.x可以匹配aaxabxa1xa#xaaaaaax需要a.....x2)[]匹配括号中的任何字符a[yui]x 可以匹配ayxauxaix0[abcdeg]90[a-z]9 不可匹配0X90[A-Z]9 可匹配0X90[^a-z]9 → hat 不能匹配小写字母3)| 或a|z的意思a 或者 zz|food的意思z 或者 food(z|f)ood的意思zood 或food4)( ) 改变优先级、定义提取组两个作用限定符:5)* 表示前面的表达式可以出现0次或者多次。a.*x 表示 ax,a1x,a11x...a[a-z]*x6)... 阅读全文
posted @ 2013-10-24 10:39 豆豆0829 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 1 using System.Text.RegularExpressions; 2 #region 验证文本框输入为数字 3 /// 4 /// 验证是不是数字(包含整数和小数) 5 /// 6 /// 7 /// 8 public static bool GetNum(string str) 9 { 10 return Regex.IsMatch(str,@"^[-]?\d+[.]?\d*$"); 11 } 12 #endregion 13 14 #region 验证文本框输入为整数 15 /// 16 /// 验证文本框输入为整数 17 /// 18 /... 阅读全文
posted @ 2013-10-24 10:37 豆豆0829 阅读(2284) 评论(0) 推荐(0) 编辑