Mono Class Library: System.String Overview | Members

System.String.Concat Method

Concatenates the string representations of two specified objects.

public static string Concat (object arg0, object arg1)

Parameters

arg0
Documentation for this section has not yet been entered.
arg1
Documentation for this section has not yet been entered.

Returns

The concatenated string representation of the values of arg0 and arg1.

Remarks

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

This version of string.Concat(object) is equivalent to string.Concat(object)( arg0.ToString(), arg1.ToString () ).

Note: If either of the arguments is an array reference, the method concatenates a string representing that array, instead of its members (for example, string )[].

Example

The following example demonstrates concatenating two objects.

C# Example

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

The output is

The concatenated Objects are: c32

Requirements

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