I am just looking if there is a better way to do the following.
Say I have the following strings:
string fooWeb = "web";
string fooDesktop = "desktop";
string fooMac = "mac";
string fooIphone = "iphone";
string fooAndroid = "android";
list<string> Names = new List<string>();
Names.Add("web");
Names.Add("mac");
Names.Add("iphone");
Names.Add("android");
I am looping through this list and i want to exclude the item which contains for example "web" & "mac" & and "android" there could be others too.
Is there a better way to achieve this than what I am trying below:
foreach (var item in this._repo.FooRepo())
if (!(item.SystemName == "Web" || item.SystemName == "android" || item.SystemName == "mac"))
{
//add to new list
}
}
I am asking, as I have around 8 strings to check against.