C# 中如何將List裏的集合轉換成字符串並按指定的字符進行分隔?

代碼:
using System;
using System.Collections.Generic;
publicclassMyClass
{
publicstaticvoidMain()
{
List<string> names =newList<string>(){"ccc","xxx","aaa","bbbb"};
names.Sort();
var result =String.Join(",", names.ToArray());
Console.Write(result);
Console.ReadKey();
}
}

 

 



相關文章
相關標籤/搜索