Join Method (String, String[])

String.Join Method (String, String[])


Concatenates all the elements of a string array, using the specified separator between each element.

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

static member Join : 
        separator:string *
        [<ParamArrayAttribute>] value:string[] -> string


Type: System.String

The string to use as a separator. separator is included in the returned string only if value has more than one element.

Type: System.String[]

An array that contains the elements to concatenate.

Return Value

Type: System.String

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

Exception Condition

value is null.

For example, if separator is ", " and the elements of value are "apple", "orange", "grape", and "pear", Join(separator, value) returns "apple, orange, grape, pear".

If separator is null, an empty string (String.Empty) is used instead. If any element in value is null, an empty string is used instead.

The following example demonstrates the Join method.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft