//字符串常用操作 string name = "one,two,three"; Console.WriteLine(name); string str2 = name.ToLower(); //变小写 string str3 = name.ToUpper(); //变大写 string str4 = name.Trim(); //去掉前面的和后面的空格 string str5 = name.TrimStart(); //去掉前面的空格 string str6 = name.TrimEnd(); //去掉后面的空格 string[] str7 = name.Split(','); //用字符分割字符串 foreach(string temp in str7) { Console.WriteLine(temp); }
标签:常用,Console,string,空格,字符串,操作,去掉,name From: https://www.cnblogs.com/librababyblogs/p/17418352.html