![]() |
VOOZH | about |
public bool Contains (T item);Here, item is the object to locate in the Collection<T>. The value can be null for reference types. Return Value: This method return True if item is found in the Collection<T>, otherwise, False. Below given are some examples to understand the implementation in a better way: Example 1: Output:
TrueExample 2:
FalseNote: This method performs a linear search. Therefore, this method is an O(n) operation, where n is Count. Reference: