18
1
using System;
2
using System.Linq;
3
4
public class Program
5
{
6
public static void Main()
7
{
8
var currencies = new[] { "USD", "EUR", "JPY" };
9
10
Console.WriteLine(currencies.Any(x => x == "MXN")); // False
11
12
Console.WriteLine(!currencies.Any(x => x == "MXN")); // True
13
14
Console.WriteLine(currencies.All(x => x != "MXN")); // True
15
16
Console.WriteLine(currencies.All(x => !x.StartsWith("M"))); // True
17
}
18
}
Cached Result