Non-generic IEnumerable for String

There are many questions / answers about converting from generic IEnumerable to string.

But I need a conversion from non-generic IEnumerable to string. The result string should be in the form.   element1.ToString() + ", " + element2.ToString() + ", " + element3.ToString() + ...
Is there a shorter way than using StringBuilder and looping through elements using MoveNext ()?

+3
source share
1 answer

You can use LINQ:

String.Join(", ", thingy.Cast<object>());
+8
source

All Articles