How to join the elements of string array in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] arr = { "Blade Runner", "The Matrix", "Star Wars", "The Terminator" };

            string s = string.Join(" : ", arr);

            Console.WriteLine(s);
        }
    }
}


/*
run:

Blade Runner : The Matrix : Star Wars : The Terminator

*/

 



answered Dec 29, 2016 by avibootz

Related questions

1 answer 147 views
1 answer 134 views
1 answer 200 views
1 answer 165 views
1 answer 149 views
1 answer 182 views
1 answer 128 views
...