且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

列表转换为字符串在C#

更新时间:2023-02-12 15:18:01

也许你正在尝试做

 字符串combindedString =的string.join(,myList.ToArray());
 

您可以与您希望通过拆分在列表中的元素的内容替换,

How do I convert a list to a string in C#?

When I execute toString on a List object, I get:

System.Collections.Generic.List`1[System.String]

Maybe you are trying to do

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

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