
- VBScript 教程
- VBScript - 主頁
- VBScript - 概述
- VBScript - 語法
- VBScript - 啟用
- VBScript - 位置
- VBScript - 變數
- VBScript - 常量
- VBScript - 運算子
- VBScript - 決策
- VBScript - 迴圈
- VBScript - 事件
- VBScript - Cookie
- VBScript - 數值
- VBScript - 字串
- VBScript - 陣列
- VBScript - 日期
- 高階 VBScript
- VBScript - 過程
- VBScript - 對話方塊
- VBScript - 面向物件
- VBScript - Reg 表示式
- VBScript - 錯誤處理
- VBScript - 其他語句
- VBScript 實用資源
- VBScript - 問題和解答
- VBScript - 快速指南
- VBScript - 實用資源
- VBScript - 討論
VBScript Join 函式
返回一個字串,其中包含陣列中指定數量的子字串。這是 Split 方法的反向函式。
語法
Join(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>
如果將上述程式碼另存為 .html 並 Internet Explorer 中執行,它將產生以下結果 −
The value of b is :Red Blue Yellow The Join result after using delimiter is : Red$Blue$Yellow
vbscript_arrays.htm
廣告