The following is the string array −
string[] str = { "Java", "AngularJS", "Python", "jQuery", "HTML5" };Firstly, join it −
string.Join(" ", str);Now to separate the above joined strings, use the Split() method as shown in the following code −
Example
using System;
public class Demo {
public static void Main() {
string[] str = { "Java", "AngularJS", "Python", "jQuery", "HTML5" };
// join words
string res = string.Join(" ", str);
Console.WriteLine("Joined Strings...\n "+res);
string[] convert = res.Split(' ');
Console.WriteLine("\nSeparate Joined Strings...");
foreach (string val in convert) {
Console.WriteLine(val);
}
}
}Output
Joined Strings... Java AngularJS Python jQuery HTML5 Separate Joined Strings... Java AngularJS Python jQuery HTML5