How to create string array from existing strings in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s1 = "c#";
        string s2 = "java";
        string s3 = "python";
        
        string[] arr = { s1, s2, s3 };

        Console.Write(string.Join(" ", arr));
    }
}



/*
run:

c# java python

*/

 



answered Oct 31, 2020 by avibootz

Related questions

3 answers 243 views
1 answer 108 views
2 answers 153 views
2 answers 146 views
1 answer 220 views
2 answers 270 views
...