Mono Class Library: System.String Overview | Members

System.String.Concat Method

Concatenates the elements of a specified array. [Edit]

public static string Concat (params string[] values)

Parameters

values
An array of string instances to concatenate. [Edit]

Returns

A string containing the concatenated elements of values. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionvalues is a null reference. [Edit]

Remarks

string.Empty is used in place of any null reference in the array. [Edit]

Example

The following example demonstrates concatenating an array of strings.

C# Example
using System;
public class StringConcatExample {
 public static void Main() {
 string str = String.Concat( "one", "two", "three", "four", "five" );
 Console.WriteLine( "The concatenated String array is: {0}", str );
 }
}
   

The output is

The concatenated String array is: onetwothreefourfive

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0