C#的Lambda表达式嵌套例子_qtC#的Lambda表达式嵌套例子_qt_02
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