Skip to content

Instantly share code, notes, and snippets.

@scottlaw1
Created July 11, 2012 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottlaw1/3089941 to your computer and use it in GitHub Desktop.
Save scottlaw1/3089941 to your computer and use it in GitHub Desktop.
Create comma-delimited list of values with LINQ aggregate
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