C# String Concat(String[])
Description
String Concat(String[])
concatenates the elements
of a specified String array.
Syntax
String.Concat(String[])
has the following syntax.
public static string Concat(
params string[] values
)
Parameters
String.Concat(String[])
has the following parameters.
values
- An array of string instances.
Returns
String.Concat(String[])
method returns The concatenated elements of values.
Example
The following example demonstrates the use of the Concat method with a String array.
// w w w . jav a2 s .co m
using System;
public class ConcatTest {
public static void Main() {
string [] s = { "hello ", "and ", "welcome ", "to ", "this ", "demo! " };
Console.WriteLine(string.Concat(s));
}
}
The code above generates the following result.