Counts number of items which match specified predicate.

Amatya
Posted by Amatya under C# category on | Points: 40 | Views : 143
Counts number of items which match specified predicate.

IEnumerable<int> dnfItems = new List<int> { 100, 200, 300, 400, 500 };
int dnfCount = dnfItems.Count(x => x < 250);



Result
dnfCount: 2

Thanks
Amatya

Comments or Responses

Login to post response