Any
Slightly different from the All operator, the Any
operator verifies that at least any one item in the list or array satisfies a particular boolean condition. If it does, then it will return true
, otherwise false
.
Basic example
Here we just want to find out if any items in the array are greater than 10.
Live example: https://dotnetfiddle.net/fmEppS
var scores = new[] { 87, 56, 33, 20, 11, -10, -50 };
var all = scores.Any(i => i > 10);
// output: true