Mono Class Library: System.String Overview | Members

System.String.Concat Method

Concatenates the string representations of the elements in an array of object instances. [Edit]

public static string Concat (params object[] args)

Parameters

args
An array of object instances to concatenate. [Edit]

Returns

The concatenated string representations of the values of the elements in args. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionargs is a null reference. [Edit]

Remarks

This method concatenates the values returned by the string.ToString methods on every object in the args array. string.Empty is used in place of any null reference in the array. [Edit]

Example

The following example demonstrates concatenating an array of objects.

C# Example
using System;
public class StringConcatExample {
 public static void Main() {
 string str = String.Concat( 'c', 32, "String" );
 Console.WriteLine( "The concatenated Object array is: {0}", str );
 }
}
   

The output is

The concatenated Object array is: c32String

Requirements

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