// using System.Linq; int[] numbers = { 1, 2, 3, 4, 5 }; int sum = numbers.Aggregate((x, y) => x + y); // Result: sum = 15
// using System.Linq; string[] words = { "hello", "world", "!" }; string result = words.Aggregate("", (x, y) => x + " " + y); // Result: result = " hello world !"Package Library: The Aggregate method is part of the System.Linq namespace in the .NET Framework Class Library.