プログラマーな日々

I'm a Cloud Architect and Developer, and a trainee of the network engineer training course. I have certified by AWS and Cisco (SAA/SOA/DVA/CCNA). I especially have highly motivated to reduce toils.

System.Collections.Generic.Listからカンマ区切りの文字列を生成する

環境

Visual Studio 2010 SP1

ソースコード

using System;
using System.Collections.Generic;

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

結果