+92 332 4229 857 99ProjectIdeas@Gmail.com

LINQ Contains() Method (C#.net)



LINQ Contains() Method (C#.net):
The following code shows you how check whether the mentioned value is in array or not. If contains then returns true else if not then returns false. See the code below.


Code

List<string> words = new List<string> { "osama","saad","shizzi","bilal","ahsan" };

var query = words.Contains("saad");

Console.Write(query);

Output of the program is:
True (because "saad" is available in List) 


see this vb.net

0 comments: