25.99.1. JOIN Details

[<<<] [>>>]

This function can be used to join several strings together. The first argument of the function is the string used to join the rest of the arguments. The rest of the argument are joined together, but also elements on an array can be joined together. See the example:

for i=1 to 8
 q[i] = I
next
print join("|",q)
print
print join("/",1,2,3,4,5,6,7,8)
print
print join(" j-s ",q,2,3,4,5,6,7,8)
print
print join("/",1)
print

will print

1|2|3|4|5|6|7|8
1/2/3/4/5/6/7/8
1 j-s 2 j-s 3 j-s 4 j-s 5 j-s 6 j-s 7 j-s 8
1

The first join joins the elements of the array. The second join joins the arguments of the function. The third example also joins the arguments although the second argument is an array. Because there are more arguments each of them is treated as single value and are joined. Whenever an array is used in place of a single value, the first element of the array is taken. In this example this is 1. The last join is a special one. In this case the join string is not used, because there is only one argument after the join string. Because this argument is not an array there are no elements of it to join.


[<<<] [>>>]