SoFunction
Updated on 2025-03-10

VBS Tutorial: Functions - Join Functions

Join function

Returns a string created by many substring concatenations contained in the array.

Join(list[delimiter])

parameter

list

Required option. Contains a one-dimensional array of substrings to be joined.

Delimiter

Optional. Characters used in the return string to separate substrings. If omitted, the null character ("") is used. ifdelimiterIt is a zero-length string, and all items are listed in the same list without a delimiter.

illustrate

The following example usesJoinFunction union substrings of MyArray:

Copy the codeThe code is as follows:

Dim MyString
Dim MyArray(3)
MyArray(0) = "Mr."
MyArray(1) = "John "
MyArray(2) = "Doe "
MyArray(3) = "III"
MyString = Join(MyArray) 'MyString contains "Mr. John Doe III".