C#-将List里的集合转换成字符串并按指定的字符进行分隔?
代码:
using System;
using System.Collections.Generic;
publicclassMyClass{
public static void Main(){
List<string> names =newList<string>(){"ccc","xxx","aaa","bbbb"};
names.Sort();
var result =String.Join(",", names.ToArray());
Console.Write(result);
Console.ReadKey();
}
}