How to convert array to string in C#

2 Answers

0 votes
using System;

class Program
{
    static void Main() {
        string[] arr = {"c#", "c", "c++",  "php"};

        string s = string.Join(" ", arr);
 
        Console.WriteLine(s);
    }
}



/*
run:

c# c c++ php

*/

 



answered Sep 10, 2020 by avibootz
0 votes
using System;
 
class Program
{
    static void Main() {
        int[] arr= {1, 2, 8, 9, 12, 100, 7, 91};
         
        string s = string.Join(" ", arr);
         
        Console.Write(s);
    }
}
 
 
 
/*
run:
   
1 2 8 9 12 100 7 91
   
*/

 



answered May 9, 2024 by avibootz
...