System.String.Join Method

Concatenates the elements of an object array, using the specified separator between each element.

Syntax

[System.Runtime.InteropServices.ComVisible(false)]
public static string Join (string separator, params object[] values)

Parameters

separator
The string to use as a separator. separator is included in the returned string only if values has more than one element.
values
An array that contains the elements to concatenate.

Returns

A string that consists of the elements of values delimited by the separator string. If values is an empty array, the method returns string.Empty.

Remarks

If separator is null or if any element of values other than the first element is null, an empty string (string.Empty) is used instead. See the Notes for Callers section if the first element of values is null.

string.Join(string, Object[]) is a convenience method that lets you concatenate each element in an object array without explicitly converting its elements to strings. The string representation of each object in the array is derived by calling that object's ToString method.

Requirements

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