Fastest Way to Add Character at First, End and Between of each string in List of string
c#, c#-4.0, join, list, string
Solution
Throwing my suggestion in:
string result = string.Join(", ", elements.Select(e => "'" + e + "'"));
Problem
This is my list: ``` List<string> elements = new List<string> { "apple", "orange", "peach" }; ``` I need a method with this return value: ``` string result = "'apple', 'orange', 'peach'"; ``` As you see the result add `"'"` to the first of each string, also at the end of them, then all of them joined with `", "`. So what is your suggestion to do it fast and fluent? also consider performance issues, and maybe this list have been a lot of elements, how about that?