Declare a string and add elements −
string[] str = { "One", "Two", "Three", "Four", "Five" };Use the Join() method to join the words−
string res = string.Join(" ", str);Let us see the complete code −
Example
using System;
public class Demo {
public static void Main() {
string[] str = { "One", "Two", "Three", "Four", "Five" };
// join words
string res = string.Join(" ", str);
Console.WriteLine(res);
}
}Output
One Two Three Four Five