C#的Lambda表达式嵌套例子

1 /*
2  *curStatsResult是List<string>类型,
3  *x.GetAllOsVersion()结果是string[]类型,
4  *这里是先使用SelectMany()返回一个结果,再用Count()进行统计数字
5  *而不是在SelectMany()中直接使用Count()方法
6 */
7 int amd64CountPart = curStatsResult.PartLost.SelectMany(
8 x => x.GetAllOsVersion()).Count(k=>k.Contains("NTamd64"));
View Code
原文地址:https://www.cnblogs.com/tommy-huang/p/5256958.html