Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Join Function

Join Function

Returns a string created by joining a number of substrings contained in an array.

Function Join(
   ByVal SourceArray() As { Object | String },
   Optional ByVal Delimiter As String = " "
) As String

Parameters

SourceArray()
Required. One-dimensional array containing substrings to be joined.
Delimiter
Optional. String used to separate the substrings in the returned string. If omitted, the space character (" ") is used. If Delimiter is a zero-length string (""), all items in the list are concatenated with no delimiters.

Exceptions/Errors

Exception type Error number Condition
ArgumentException 5 SourceArray() is not one dimensional.

Example

The following example demonstrates use of the Join function.

Dim myItem(2) As String
Dim myShoppingList As String
myItem(0) = "Pickle"
myItem(1) = "Pineapple"
myItem(2) = "Papaya"
' Returns "Pickle, Pineapple, Papaya"
myShoppingList = Join(myItem, ", ")

Requirements

Namespace: Microsoft.VisualBasic

Module: Strings

Assembly: Microsoft Visual Basic .NET Runtime (in Microsoft.VisualBasic.dll)

See Also

Split Function | ArgumentException

Show:
© 2015 Microsoft