Join Function

Assigns a value to a String variable by concatenating the elements of a String array.

Syntax
result = Join( sourceArray, [delimiter] )

Parameters
sourceArray | String | Source array whose elements will be used to created result.
delimiter | String (Optional) | Optional delimiter used in separating the elements of sourceArray when creating result. The default is one space.

Return Value
Result | String | String that results from concatenating all the elements of sourceArray, optionally separated by delimiter.

# Notes

Join takes a String array and concatenates the individual elements into a single String variable. You can pass an optional delimiter which will be inserted between the fields in the resulting String. If no delimiter is passed, a single space will be used as the delimiter.

The Split function performs the opposite function. It takes a String and creates an array by parsing the string into array elements using a specified delimiter.

# Examples

This example concatenates a three-element array into the string

"Anthony,Aardvark,Accountant".

Dim myArray(2) as String
Dim s as String
myArray= Array("Anthony","Aardvark","Accountant")
//specifying the comma delimiter
s=Join(myArray,",") //creates "Anthony,Aardvark,Accountant"

# See Also

Dim statement; Array, NthField, Split, Ubound, functions; Append, IndexOf, Insert, Pop, Redim, Remove, Shuffle, Sort, Sortwith methods; ParamArray keyword.