// 0 is the seed, and for each item, we effectively increment the current value.// In this case we can ignore "item" itself.int count = sequence.Aggregate(0, (current, item) => current + 1);
或者可以将字符串序列中的所有字符串长度相加:
int total = sequence.Aggregate(0, (current, item) => current + item.Length);