一个函数,它返回一个字符串,该字符串在数组中包含指定数目的子字符串。这与拆分方法完全相反。
句法
Join(List[,delimiter])
- List,一个必需参数。一个包含要连接的子字符串的数组。
- delimiter,一个可选参数。字符,在返回字符串时用作定界符。默认定界符为空格。
例
<!DOCTYPE html>
<html>
<body>
<script language = "vbscript" type = "text/vbscript">
' Join using spaces
a = array("Red","Blue","Yellow")
b = join(a)
document.write("The value of b " & " is :" & b & "<br />")
' Join using $
b = join(a,"$")
document.write("The Join result after using delimiter is : " & b & "<br />")
</script>
</body>
</html>
结果:
The value of b is :Red Blue Yellow The Join result after using delimiter is : Red$Blue$Yellow
作者:terry,如若转载,请注明出处:https://www.web176.com/vbscript/1193.html
支付宝
微信