Skip to content

Instantly share code, notes, and snippets.

@NaserKhoshfetrat
Created June 13, 2018 06:20
Show Gist options
  • Save NaserKhoshfetrat/3f08e45436610e96cc39207fd00a7ce2 to your computer and use it in GitHub Desktop.
Save NaserKhoshfetrat/3f08e45436610e96cc39207fd00a7ce2 to your computer and use it in GitHub Desktop.
c# convert list to string
private string Stringify(string[] list,string seprator) {
string result = string.Empty;
/*
var result = list
.Skip(1)
.Aggregate(
list.FirstOrDefault() ?? string.Empty,
(total, current) => total + "," + current);
*/
result = string.Join(seprator, list);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment