How to convert array of integers to comma-separated string in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        int[] arr = {5, 9, 0, 7, 3, 2};
        
        var s = string.Join(",", arr);
        
        Console.WriteLine(s);
    }
}




/*
run:

5,9,0,7,3,2

*/

 



answered Jun 23, 2021 by avibootz
...