एक स्ट्रिंग घोषित करें और तत्व जोड़ें:
string[] str = { "One", "Two", "Three", "Four", "Five" };
शब्दों को जोड़ने के लिए Join() विधि का उपयोग करें:
string res = string.Join(" ", str);
आइए पूरा कोड देखें:
उदाहरण
using System;
public class Demo {
public static void Main() {
string[] str = { "One", "Two", "Three", "Four", "Five" };
// शब्द जोड़ें
string res = string.Join(" ", str);
Console.WriteLine(res);
}
}
आउटपुट
One Two Three Four Five