Why is ToArray() used when using string.Join with a List<string>?

c#

Solution

`string.Join` only started accepting `IEnumerable<string>` (and indeed a generic overload) as of .NET 4. Presumably you're looking at code (or instructions) written with .NET 3.5 or earlier in mind. Compare the overloads:

- `string.Join` in .NET 3.5

- `string.Join` in .NET 4

Problem

I'm trying to combine `List<string> strings` using `string.Join(",", strings)` but everything I'm reading says I should do: `string.Join(",", strings.ToArray())` Is there a certain reason I have to/should use `.ToArray()`?

Original source