Convert a list to a string in C#

Maybe you are trying to do

string combinedString = string.Join( ",", myList.ToArray() );

You can replace “,” with what you want to split the elements in the list by.

Edit: As mentioned in the comments you could also do

string combinedString = string.Join( ",", myList);

Reference:

Join<T>(String, IEnumerable<T>) 
Concatenates the members of a collection, using the specified separator between each member.

Leave a Comment