System.String.Concat Method

Concatenates two specified instances of string.

Syntax

public static string Concat (string str0, string str1)

Parameters

str0
The first string to concatenate.
str1
The second string to concatenate.

Returns

The concatenation of str0 and str1.

Remarks

The method concatenates str0 and str1; it does not add any delimiters.

An string.Empty string is used in place of any null argument.

Example

The following example demonstrates concatenating two strings.

C# Example

using System;
public class StringConcatExample {
 public static void Main() {
 string str = String.Concat( "one", "two" );
 Console.WriteLine( "The concatenated strings are: {0}", str );
 }
}
   

The output is

The concatenated strings are: onetwo

Requirements

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