VBScript:Join函数

目录

一个函数,它返回一个字符串,该字符串在数组中包含指定数目的子字符串。这与拆分方法完全相反。

句法

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

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2020年12月8日 上午11:03
下一篇 2020年12月8日 上午11:12

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注