Aggregate可以做字符串累加、数值累加、最大最小值

Aggregate("", (m, n) => m + n + "、").TrimEnd('、');

.Aggregate(0, (m, n) => m + (n.IsNotNull()? (int)n :0));

Aggregate(0, (m, n) => Math.Max(m ,(n.IsNotNull() ? (int)n : 0)));

posted on 2018-02-04 08:47  mol1995  阅读(198)  评论(0编辑  收藏  举报

导航