String.Join Method (String, String[])
.NET Framework (current version)
Concatenates all the elements of a string array, using the specified separator between each element.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- separator
-
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.
- value
-
Type:
System.String[]
An array that contains the elements to concatenate.
Return Value
Type: System.StringA 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 |
|---|---|
| ArgumentNullException | 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.
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: