Created
June 13, 2018 06:20
-
-
Save NaserKhoshfetrat/3f08e45436610e96cc39207fd00a7ce2 to your computer and use it in GitHub Desktop.
c# convert list to string
This file contains hidden or 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
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