How to get a comma separated string from an array in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string[] arr = { "c#", "java", "python", "swift", "javascript" };
  
        string s = String.Join(", ", arr);
  
        Console.WriteLine(s);
    }
}
  
  
  
/*
run:
  
c#, java, python, swift, javascript
  
*/

 



answered Nov 2, 2020 by avibootz

Related questions

...