+92 332 4229 857 99ProjectIdeas@Gmail.com

LINQ Contains() Method (Vb.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.







Dim number1() As Integer = {6, 8, 9, 5, 7}

Dim valueToSearch As Integer = 19

Dim result As Boolean = number1.Contains(valueToSearch)

Console.Write(result)

Output of the program is:
False (because number1 array doesnot contain 19) 

see this in c#.net

0 comments: