排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

Console.WriteLine("请输入英文,中间用空格隔开"); //定义变量接受 string English = Console.ReadLine(); //根据空格分割 string[] letter = English.Split(' '); string str = ""; for (int i = 0; i < letter.Length; i++) { //判断是否是多个连续空格,去除空格 if (letter[i].ToString() == "") { continue; } //将数组不是空格的值开头字母大写,后面字母小写 letter[i] = letter[i].Substring(0, 1).ToUpper() + letter[i].Substring(1).ToLower(); //拼接字符串 str += letter[i]; } Console.WriteLine(str);
评价