C# 如何判断一个字符串是否包含另一个字符串的方法,C# IndexOf 的使用
static void Main(string[] args)
{
string str = "Hello Word";
string a = "e";
if (str.IndexOf(a) >= 0)
{
Console.WriteLine("存在指定字符串.");
}
Console.Read();
}
C# 如何判断一个字符串是否包含另一个字符串的方法,C# IndexOf 的使用
static void Main(string[] args)
{
string str = "Hello Word";
string a = "e";
if (str.IndexOf(a) >= 0)
{
Console.WriteLine("存在指定字符串.");
}
Console.Read();
}