METHOD
Enumerable.Count
Counts matching elements; no-predicate overload counts all.
Formal Syntax & Structure
csharp syntaxcsharp
source.Count(predicate)Working Example
Example Snippetcsharp
using System;using System.Linq;int count = new[] {1,2,3}.Count(n => n > 1);