Join() returns one string made from the elements of a one-dimensional array. If the delimiter is omitted, VBScript uses a single space.
myString = Join(myArray)
Supply a delimiter when you want a specific separator:
myString = Join(myArray, ",")
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().
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.