Opposite of Any in LINQ is All

CSharp · Console

/Program.cs

using System;
using System.Linq;
					
public class Program
{
	public static void Main()
	{
		var currencies = new[] { "USD", "EUR", "JPY" };
		
		Console.WriteLine(currencies.Any(x => x == "MXN"));   // False
		
		Console.WriteLine(!currencies.Any(x => x == "MXN"));  // True
			
		Console.WriteLine(currencies.All(x => x != "MXN"));   // True
		
		Console.WriteLine(currencies.All(x => !x.StartsWith("M")));  // True
	}
}
;