System.String.Concat Method

Concatenates the string representations of three specified objects.

Syntax

public static string Concat (object arg0, object arg1, object arg2)

Parameters

arg0
The first object to concatenate.
arg1
The second object to concatenate.
arg2
The third object to concatenate.

Returns

The concatenated string representations of the values of arg0, arg1, and arg2.

Remarks

The method concatenates arg0, arg1, and arg2 by calling the parameterless ToString method of each object; it does not add any delimiters.

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

Example

The following example demonstrates concatenating three objects.

C# Example

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

The output is

The concatenated Objects are: c32String

Requirements

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