Answer: Exist returns true if a List item is found otherwise returns false.We have to match with predicate parameters.
For Example:-
List<int> lst = new List<int>();
lst.Add(1);
lst.Add(2);
bool exists = lst.Exists(value => value > 1);
It returns true because we have checked here value > 1,and List also contains 2.
Asked In: Many Interviews |
Alert Moderator