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:
0 comments:
Post a Comment