Answer: With Contains method,we can check.It returns true if item is there in a List otherwise returns false.It's same as String Contains method which checks for particular Texts or Words in a string.So in case of List Contains,it does the same things.Instead of String,it checks items inside a List.
Syntax:-
If lst.Contains("any items") Then
'perform any action
End If
Where lst is my Generic List object.
Asked In: Many Interviews |
Alert Moderator