示例
代码
internal class Program
{
static void Main(string[] args)
{
List<int> list = new List<int>() { 1,2,3,4,5,6,7,8,9,10};
string output1 = string.Join(",", list);
Console.WriteLine(output1);
string output2 = string.Join("\n", list);
Console.WriteLine(output2);
Console.ReadLine();
}
}
string.Join(",", list);
第一个参数按什么将数组每个元素分开
第二个参数为数组