user1306322 user1306322 - 1 year ago 83
C# Question

Convert list of objects to string in one line

I have a list of objects that implement

. I need to convert the whole list to one string in one line. How can I do that?

Answer Source

Another method that may help out is string.Join, which takes a set of objects and will join them with any delimiter you want. For instance:

var combined = string.Join(", ", myObjects);

will make a string that is comma/space separated.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download