String::Join Method (String, array<Object>)
Concatenates the elements of an object array, using the specified separator between each element.
Assembly: mscorlib (in mscorlib.dll)
[ComVisibleAttribute(false)] public: static String^ Join( String^ separator, ... array<Object^>^ values )
- Type: System::String
The string to use as a separator. separator is included in the returned string only if values has more than one element.
- Type: array<System::Object>
An array that contains the elements to concatenate.
If separator is nullptr or if any element of values other than the first element is nullptr, an empty string (String::Empty) is used instead. See the Notes for Callers section if the first element of values is nullptr.
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.Notes to Callers
If the first element of values is nullptr, the method does not concatenate the elements in values but instead returns String::Empty. A number of workarounds for this issue are available. The easiest is to assign a value of String::Empty to the first element of the array, as the following example shows.
.NET FrameworkSupported in: 4.6, 4.5, 4
.NET Framework Client ProfileSupported in: 4
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)