情況我有以下if
條件:建築如果從陣列
if (!string.IsNullOrEmpty(str) &&
(!str.ToLower().Contains("getmedia") && !str.ToLower().Contains("cmsscripts") &&
!str.ToLower().Contains("cmspages") && !str.ToLower().Contains("asmx") &&
!str.ToLower().Contains("cmsadmincontrols"))
)
我想創建關鍵字,而不是把多個AND
條件的數組,你可以請幫助?
string[] excludeUrlKeyword = ConfigurationManager.AppSettings["ExcludeUrlKeyword"].Split(',');
for (int i = 0; i < excludeUrlKeyword.Length; i++)
{
var sExcludeUrlKeyword = excludeUrlKeyword[i];
}
如何從數組中構建相同的條件?
使用LINQ的任何或我們可以在沒有LINQ的情況下編寫所有 – Oasis
嗎? – SmartestVEGA