检查列表中是否存在项目
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
产生以下输出:
False
True
False