How to join array elements into a string with C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        int[] arr = {5, 8, 2, 0, 1, 9};
         
        string s = string.Join(" ", arr);
 
        Console.Write(s);
    }
}




/*
run:

5 8 2 0 1 9

*/

 



answered Nov 26, 2020 by avibootz

Related questions

1 answer 139 views
1 answer 206 views
1 answer 177 views
1 answer 161 views
1 answer 195 views
1 answer 132 views
1 answer 206 views
...