c# - Bool list check if every item in list is false -


i have list<bool> lots of values. efficient way check if every single item in list equals false?

you can use enumerable.any find satisfy condition on first match. habib rightly said better use enumerable.all return true empty list of bool.

!lst.any(c=> c == true); 

or use enumerable.all

lst.all(c=> c == false); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -