我开始在 linq 中重写以下代码,但无济于事。你能帮我解决这个问题吗?
bool bReturn = false;
string[] divs = strExport.Split(chrDivSep);
// bReturn = divs.Any(D => D.Split(chrItemSep).Any(C => C.Split(chrCoupleSep)[0].ToUpper() == "TABLE"));
foreach (string strdiv in divs)
{
string[] items = strdiv.Split(chrItemSep);
foreach (string item in items)
{
string[] couple = item.Split(chrCoupleSep);
switch (couple[0].ToUpper())
{
case "TABLE":
// There is a non constant field
bReturn = true;
break;
}
if (bReturn)
break;
}
if (bReturn)
break;
}
return bReturn;