Reputation: 1
Imagine I've this following List
:
List<string> thirdList = new List<string> {"0","0","56'BCD"}
I need to add all of its items to a new list as one value i.e., "0 0 56'BCD
. Please note that there is space between the items in the new string. Thanks in advance.
Upvotes: 0
Views: 4196
Reputation: 460038
So you want a list with a single string? You can use String.Join
:
var result = new List<string>{ String.Join(" ", thirdList) };
Upvotes: 13