IsMaych 我列举的其中的一种public static void RunIsMatch() { string inputString = "Welcome to the publishers, Wrox Pree Ltd"; if (Regex.IsMatch(inputString, "wrox pree", RegexOptions.IgnoreCase))//匹配在inputStrin... Read More
posted @ 2010-10-20 08:56 gull Views(287) Comments(0) Diggs(0) Edit
public static void output() { String s = "aa,bb,cc dd, ee"; const char comma = ','; const char space = ' '; char[] schar = new char[] { comma, space }; foreach (String s1 in s.Split(schar)) { Console... Read More
posted @ 2010-10-19 11:04 gull Views(229) Comments(0) Diggs(0) Edit
class Class1 { public void Display(params int[] values) //定义一个参数不限定 { foreach (int val in values) { Console.WriteLine("Class1:{0}",val.ToString()); } } }Class1 class1 = new Class1(); Int32[] digiTal... Read More
posted @ 2010-10-18 15:38 gull Views(174) Comments(0) Diggs(0) Edit
public struct Location { private int _xVal; private int _yVal; public Location(int xCoordinate, int yCoordinate) { _xVal = xCoordinate; _yVal = yCoordinate; }public int xVal { get { return xVal; } set... Read More
posted @ 2010-10-18 13:03 gull Views(236) Comments(0) Diggs(0) Edit
class Fraction { private int _numerator; private int _denominator; public Fraction(int numerator, int denominator) { this._numerator = numerator; this._denominator = denominator; } public overrid... Read More
posted @ 2010-10-18 10:21 gull Views(550) Comments(0) Diggs(0) Edit
enumColor:byte{ Red, Green, Blue, Orange}Console.WriteLine(Enum.GetUnderlyingType(typeof(Color))); //输出枚举类型Color c = Color.Blue; Console.WriteLine(c.ToString());//转化为字符串 Console.WriteLine(c.ToString(... Read More
posted @ 2010-10-15 08:46 gull Views(282) Comments(0) Diggs(0) Edit
StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0} {1}", "Jeffrey", "Richer").Replace(" ","-");String s = sb.ToString().ToUpper();sb.Length = 0; sb.Append(s).Insert(8, "Marc-"); s = sb.ToSt... Read More
posted @ 2010-10-13 09:18 gull Views(3687) Comments(0) Diggs(0) Edit