- string[] strs = new string[2];
- for (int i = 0; i < strs.Length; i++)
- {
- strs[i] = Console.ReadLine();
- }
- if (strs[0].Equals(strs[1], StringComparison.OrdinalIgnoreCase))
- {
- Console.WriteLine("两个字符串相等");
- }
- else Console.WriteLine("不相等");
- Console.ReadKey();
复制代码 |