How to count the number of elements that match a condition with LINQ

前端 未结 5 1003
遇见更好的自我
遇见更好的自我 2020-11-29 12:09

I\'ve tried a lot of things but the most logical one for me seems this one:

int divisor = AllMyControls.Take(p => p.IsActiveUserControlChecked).Count();
<         


        
5条回答
提交回复
热议问题