8_6学习内容演练。
Console.Write("请输入字符串"); string strA = Console.ReadLine(); Console.Write("请输入要查找的字符"); string strB = Console.ReadLine(); int m = 0 , n = 0; bool isContains = strA.Contains(strB); if (isContains) for (int i = 0; i < strA.Length; i++) { m = strA.IndexOf(strB, i); if (m == i) { Console.WriteLine("出现的索引位置为" + m); n++; } } Console.WriteLine("出现的次数为" + n); Console.ReadLine();