110,539
社区成员
发帖
与我相关
我的任务
分享
for (int i = 0; i < CurrentStr[4].Length; tm++)
{
if (Array.BinarySearch(TemplateStr, CurrentStr[i]) < 0)
{
return true;
}
}
static void Main(string[] args)
{
string TemplateStr = "'aaa','bbb','ccc','ddd'";
string CurrentStr = "'ggg','ccc','ttt','ddd'";
string[] temp = TemplateStr.Split(new char[] { ',' });
string[] current = CurrentStr.Split(new char[] { ',' });
for (int i = 0; i < temp.Length; i++)
{
for (int j = 0; j < current.Length; j++)
{
if(temp[i].Equals(current[j]))
Console.WriteLine("ok");
}
}
Console.ReadLine();
}
//自行优化..
foreach (string var in CurrentStr.Split(','))
{
if (TemplateStr.IndexOf(var) != -1)
{
return true;
}
}
return false;
return (TemplateStr == CurrentStr);