How to create a comma separated string from list in C#

1 Answer

0 votes
using System;
using System.Collections.Generic;

class Program
{
    static void Main() {
        IList<string> list = new List<string>{"c#", "c++", "c", "java"};
        
        string s = string.Join(",", list);

        System.Console.WriteLine(s);
    }
}




/*
run:

c#,c++,c,java

*/

 



answered Jun 15, 2021 by avibootz

Related questions

...