Mono Class Library: System.String Overview | Members

System.String.Join Method

Concatenates a specified separator string between the elements of a specified string array, yielding a single concatenated string. [Edit]

public static string Join (string separator, string[] value, int startIndex, int count)

Parameters

separator
A string. [Edit]
value
A string array. [Edit]
startIndex
A int containing the first array element in value to join. [Edit]
count
A int containing the number of elements in value to join. [Edit]

Returns

A string consisting of the specified strings in value joined by separator. Returns string.Empty if count is zero, value has no elements, or separator and all the elements of value are Empty. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeExceptionstartIndex plus count is greater than the number of elements in value. [Edit]

Remarks

Documentation for this section has not yet been entered. [Edit]

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, 1, 2 ) );
 }
}

The output is

Green :: Blue

Requirements

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