华佗小知识
您的当前位置:首页小用lambda表达式,查询数组里大于80的个数

小用lambda表达式,查询数组里大于80的个数

来源:华佗小知识

 

本身对lambda没有涉及,这个小技巧简单记录下,方便以后用。

int[] scores = { 90, 71, 82, 93, 75, 82 };

// The call to Count forces iteration of the source
int highScoreCount = scores.Where(n => n > 80).Count();

int asad = highScoreCount;

转载于:https://www.cnblogs.com/Cuiy/p/3453331.html

因篇幅问题不能全部显示,请点此查看更多更全内容