What is the use of Exists method of Generic method in C#?

 Posted by Rajesh_Kumar on 1/18/2014 | Category: C# Interview questions | Views: 1130 | Points: 40

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>();

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 

Comments or Responses

Login to post response