Just use String.Join
- not part of LINQ, just framework:
string joined = string.Join(", ", array);
If this is really too complicated for you, you can write an extension method:
public static string JoinStrings(this string[] bits, string separator) { return string.Join(separator, bits); }
Note that .NET 4 has more overloads for String.Join
, including accepting sequences (not just arrays), not just strings.
I would suggest that you are not just using the name Join
, as it will look like you are making an internal join.
source share