var oneList = new List<string>
{
"1",
"2",
"3"
};
var oneString = string.Join("'" + ",'", oneList.ToArray());
var twoList = new List<int>
{
1,
2,
3
};
var twoString = string.Join(",", twoList.ToArray());
Console.WriteLine();
Console.WriteLine(oneString);
Console.WriteLine();
Console.WriteLine(twoString);
Console.ReadKey();
输出结果
标签:ToArray,Console,C#,SqlServer,List,WriteLine,var,Join From: https://www.cnblogs.com/hyl0305/p/17108158.html