Created
July 11, 2012 12:03
-
-
Save scottlaw1/3089941 to your computer and use it in GitHub Desktop.
Create comma-delimited list of values with LINQ aggregate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int[] numbers = new[] {1, 5, 8, 26, 35, 42}; | |
var result = numbers.Aggregate("", (current, item) => current + item.ToString() + ","); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment