1. 程式人生 > >c# 將陣列或集合 轉換成以逗號分隔的字串

c# 將陣列或集合 轉換成以逗號分隔的字串

class Program     {         static void Main(string[] args)         {             List<string> list = new List<string>();             list.Add("1");             list.Add("2");             list.Add("3");             string str = string.Join(",",list.ToArray());             Console.WriteLine(str);             Console.ReadKey();         }     }