CHECK if item exists in a list - Lists - Visual Basic .NET
Learn
Visual Basic .NET - Lists - Check if item exists in a list
Check if item exists in a List
Sub Main()
Dim People = New List(Of String)({"Bob Barker", "Ricky Bobby", "Jeff Bridges"})
Console.WriteLine(People.Contains("Rick James"))
Console.WriteLine(People.Contains("Ricky Bobby"))
Console.WriteLine(People.Contains("Barker"))
Console.Read
End Sub
Produces the following output:
FalseTrueFalse
Syntax
List.Add(item As Type)
List.RemoveRange(index As Integer, count As Integer)