VBScript » Functions » Join

Version: 2.0

Syntax:
Join(Array, Delimiter)
Array
The Array argument is the name of the array to be joined.
Delimiter
The optional Delimiter argument specifies the characters (including blanks) you wish to place between each element. If this argument is not specified, the default is to place a blank space between each element. If you wish to have no spaces, use a double quote, "", for the argument.

The Join function combines substrings (elements) of an array together into one long string with each substring separated by the delimiter string.

Examples

Code:
<% Dim cowarray(10) %>
<% cowarray(0) = "How" %>
<% cowarray(1) = "now" %>
<% cowarray(2) = "brown" %>
<% cowarray(3) = "cow?" %>
<% Join(cowarray) %>
Output:
How now brown cow?
Language(s): VBScript
Code:
<% Dim arraycow(10) %>
<% arraycow(0) = "How" %>
<% arraycow(1) = "now" %>
<% arraycow(2) = "brown" %>
<% arraycow(3) = "cow?" %>

<% =Join(arraycow, 1234) %>
<% =Join(arraycow, "****") %>
<% =Join(arraycow, "") %>
Output:
How1234now1234brown1234cow?1234123412341234123412341234
How****now****brown****cow?****************************
Hownowbrowncow?
Language(s): VBScript

See Also: