I am using the following steps to check an array or list. Included value:
string[] Names= { /* */}; string target = ""; if(Array.IndexOf(Names, target) > -1) //Do
So, is there a linq command to test this?
Do you mean the Linq method?
If yes, then one:
Names.Contains(target)
Note that there is no need for a lambda here.
Names.Any( s => s == target );
Something like that?
Names.Any(n => Equals(n, target));
string[] Names= { /* */}; string target = ""; if(Names.Contains(target)) //Do