C# 两个字符串的比较

string StrA = "ABCDE";

string StrB = "AE";

char[] ArryA = StrA.ToCharArray();

char[] ArryB = StrB.ToCharArray();

int number = 0;

for (int j = 0; j < ArryA.Length; j++)

{

for (int i = 0; i < ArryB.Length; i++)

{

if (ArryA[j].Equals(ArryB[i]))

{

number++;

}

}

}

if (number == StrB.Length)

{

Console.WriteLine("true");

}

else

{

Console.WriteLine("false");

}

Console.ReadKey();