As the title says: Why does string.Join need to take an array instead of an IEnumerable? This keeps annoying me, since I have to add a .ToArray() when I need to create a joined string from the result of a LINQ expression.
My experience tells me that I’m missing something obvious here.
Upgrade to .NET 4.0 and use the overload that accepts an
IEnumerable<string>. Otherwise, just accept that it was a long outstanding problem that wasn’t addressed until .NET 4.0. You can fix the problem by creating your own extension method too!Usage: