string str1 = "test"; string str2 = "It is only a test."; if (str2.IndexOf(str1) > -1) { MessageBox.Show("str1 是 str2 的一个子串"); } else { MessageBox.Show("str1 不是 str2 的一个子串"); }
110,533
社区成员
642,574
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧