版权声明:转载原创文章请以超链接形式请注明原文章出处,尊重作者,尊重原创!
恰饭广告
判断英文单词个数:
using System; namespace FindWord { class Program { static void Main(string[] args) { string space = " "; string str = "hello world" + space; int count = 0; bool start = false; for (int i=0;i<str.Length;i++) { if (Char .IsLetter(str[i])) { start = true; } if (!Char.IsLetter(str[i])&&start) { count++; start = false; } } Console.WriteLine(count); Console.ReadLine(); } } }
原文链接:https://www.idaobin.com/archives/962.html
让我恰个饭吧.ヘ( ̄ω ̄ヘ)
恰饭广告