c# 求提供思路,我str1“i want to eat an apple” str2"i want eat apple"用什么方法可以识别出str2少了
问题描述:
c# 求提供思路,我str1“i want to eat an apple” str2"i want eat apple"用什么方法可以识别出str2少了
to 和an两个单词
答
string str1="i want to eat an apple"; string str2="i want eat apple"; Console.WriteLine(str1.Length); Console.Write(str2.Length); Console.ReadKey();第一个长度是...谢谢,那我怎么知道少了什么呢。。。string[] aa;string[] bb; string str1="i want to eat an apple"; string str2="i want eat apple"; aa = str1.Split(' '); bb = str2.Split(' '); int count=0; foreach(string c in aa) { count = 0; for (int i = 0; i