聚合操做

聚合操做

Aggregatespa

Performs a custom aggregation operation on the values in the collection.code

  1. IList<String> strList =newList<String>(){"One","Two","Three","Four","Five"};
  2. var commaSeperatedString = strList.Aggregate((s1, s2)=> s1 +", "+ s2);
  3. Console.WriteLine(commaSeperatedString);
  4. //Results
  5. One,Two,Three,Four,Five

Averageorm

calculates the average of the numeric items in the collection.element

Countit

Counts the elements in a collection.io

LongCountform

Counts the elements in a collection.class

MaxList

Finds the largest value in the collection.co

Min

Finds the smallest value in the collection.

Sum

Calculates sum of the values in the collection.

相關文章
相關標籤/搜索