METHOD

Enumerable.All

Tests whether every element satisfies the condition; true for empty input.

Formal Syntax & Structure

csharp syntaxcsharp
source.All(predicate)

Working Example

Example Snippetcsharp
using System;using System.Linq;bool ok = Array.Empty<int>().All(n => n > 0);
C# & .NET Reference