एक स्ट्रिंग घोषित करें और तत्व जोड़ें -
string[] str = { "One", "Two", "Three", "Four", "Five" }; शब्दों को जोड़ने के लिए ज्वाइन () विधि का प्रयोग करें-
string res = string.Join(" ", str); आइए देखें पूरा कोड -
उदाहरण
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);
}
} आउटपुट
One Two Three Four Five