Mono Class Library: System.String Overview | Members

System.String.Join Method

Concatenates the elements of a specified string array, inserting a separator string between each element pair and yielding a single concatenated string.

public static string Join (string separator, string[] value)

Parameters

separator
A string.
value
A string array.

Returns

A string consisting of the elements of value separated by instances of the separator string.

Exceptions

TypeReason
ArgumentNullExceptionvalue is a null reference.

Remarks

Documentation for this section has not yet been entered.

Example

The following example demonstrates the string.Join(string, String[]) method.

C# Example

using System;
public class StringJoin {
 public static void Main() {
 String[] strAry = { "Red" , "Green" , "Blue" };
 Console.WriteLine( String.Join( " :: ", strAry ) );
 }
}

The output is

Red :: Green :: Blue

Requirements

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