Convert an Array to a String with Join()

Join() returns one string made from the elements of a one-dimensional array. If the delimiter is omitted, VBScript uses a single space.

Syntax

myString = Join(myArray)

Supply a delimiter when you want a specific separator:

myString = Join(myArray, ",")

Complete example

Dim myArray(3), item, myString
myArray(0) = "UK"
myArray(1) = "USA"
myArray(2) = "Canada"
myArray(3) = "UAE"

For Each item In myArray
    Response.Write item & "<br>"
Next

myString = Join(myArray, ",")
Response.Write myString & "<br>"

The final string is UK,USA,Canada,UAE. To perform the reverse operation, use Split().


ASP Home






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer