String.Join Method (String, Object())
Concatenates the elements of an object array, using the specified separator between each element.
Assembly: mscorlib (in mscorlib.dll)
<ComVisibleAttribute(False)> Public Shared Function Join ( separator As String, ParamArray values As Object() ) As String
The string to use as a separator.separator is included in the returned string only if values has more than one element.
An array that contains the elements to concatenate.
If separator is null or if any element of values other than the first element is null, an empty string (String.Empty) is used instead. See the Notes for Callers section if the first element of values is null.
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 null, the 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.method does not concatenate the elements in values but instead returns
The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a integer array, which it then passes to themethod.
Private Sub Application_NewProject(ByVal pj As Microsoft.Office.Interop.MSProject.Project) Handles Application.NewProject Dim newTask As MSProject.Task newTask = pj.Tasks.Add _ ("This text was added by using code") newTask.Start = DateTime.Now newTask.Duration = "3" newTask.ResourceNames = "Rob Caron, Kelly Krout" End Sub
Available since 4.5
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Available since 8.1