标签:style blog color 2014 io for
字符串讲解 参考MSDN
方法
string.ToLower()
string.ToUpper()
string.Equals
属性:
string.length
字符串分割:
string str = "How are you ?Fine,Thank you?"; string[] words = str.Split(‘‘,‘?‘,‘!‘,‘,‘);
分割方法的重载
string str = "How are you ?Fine,Thank you?"; char[] removeChar={‘ ‘,‘?‘,‘!‘,‘,‘}; string[] words = str.Split(removeChar,StringSplitOptions.RemoveEmptyEntries) Console.WriteLine("上句话共有{0}个单词", words.Length); for (int i = 0; i < words.Length; i++) { Console.WriteLine(words[i]); } Console.ReadKey();
string.replace
标签:style blog color 2014 io for
原文地址:http://www.cnblogs.com/leong/p/3835375.html