VBScript JoinFunction


VBScript 参考手册Complete VBScript Reference

The Join function returns a string composed of several substrings in an array.

Syntax

Join(list[,delimiter])

Parameters Description
list Required. A one-dimensional array containing the substrings to be joined.
delimiter Optional. The character used to separate substrings in the returned string. The default is a space character.

Example

Example

Separate the items in an array, with and without using the delimiter parameter:

<script type="text/vbscript">

days=Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
document.write(Join(days) & "<br />")
document.write(Join(days,",") & "<br />")
document.write(Join(days," ### "))

</script>

The output of the above example is:

Sun Mon Tue Wed Thu Fri Sat
Sun,Mon,Tue,Wed,Thu,Fri,Sat
Sun ### Mon ### Tue ### Wed ### Thu ### Fri ### Sat

Try it Yourself »

VBScript 参考手册Complete VBScript Reference Other Extensions