Mega Code Archive

 
Categories / C# Book / 02 Essential Types
 

0245 Join string

Join method from string type is a static method which concatenate an array of string with delimiter. It does the opposite of Split method. using System; class Sample { public static void Main() { string[] arr = new string[] { "RNT", "soft", ".com" }; string s = string.Join(" ", arr); Console.WriteLine(s); } } The output: RNT soft .com