Join()
函式返回一個包含陣列中指定數量的子串的字串。這是Split
方法的一個完全相反的功能。
Join(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