Concat Method (String[])

String.Concat Method (String[])

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Concatenates the elements of a specified String array.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static string Concat(
	params string[] values


Type: System.String []
An array of string instances.

Return Value

Type: System.String
The concatenated elements of values.


values is null.


Out of memory.

The method concatenates each object in values; it does not add any delimiters.

An Empty string is used in place of any null object in the array.

The following code example demonstrates the use of the Concat method with a String array.

using System;

public class Example
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)

      // make an array of strings. Note that we have included spaces
      string[] s = { "hello ", "and ", "welcome ", "to ", "this ", "demo! " };

      // put all the strings together
      outputBlock.Text += string.Concat(s) + "\n";

      // sort the strings, and put them together
      outputBlock.Text += string.Concat(s) + "\n";

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2016 Microsoft