Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent of JavaScript's [].some() in C#?

Tags:

c#

Does an equivalent of the JavaScript Array.some() function exist in C#?

like image 525
L0laapk3 Avatar asked Sep 21 '25 13:09

L0laapk3


1 Answers

Yes there is: Any

var foo = new object[10];
var some = foo.Any(x => x != null);
like image 133
Sebastian Schumann Avatar answered Sep 23 '25 03:09

Sebastian Schumann