Join这个函数,返回一个包含子字符串数组中的指定数量的字符串。这与 Split方法的作用完全相反。
语法
Join(List[,delimiter])
-
List, 必需的参数。要加入包含属于子数组。
-
delimiter, 一个可选的参数。字符就是返回的字符串,用作分隔符。缺省的分隔符是空格。
例子 :
添加一个按钮,并添加以下功能
Private Sub Constant_demo_Click()
' Join using spaces
a = array("Red","Blue","Yellow")
b = join(a)
msgbox("The value of b " & " is :" & b)
' Join using $
b = join(a,"$")
msgbox("The Join result after using delimiter is : " & b)
End Sub
当执行函数输出如下所示:
The value of b is :Red Blue Yellow
The Join result after using delimiter is : Red$Blue$Yellow