End result :
VB Code:
Private Function split2(ByVal strString As String, ByVal strDelimeter As String) As String() Dim strTemp() As String: strTemp = Split(strString, strDelimeter) Dim i As Long, n As Long, arrRetVal() As String: ReDim arrRetVal((UBound(strTemp) - 1) / 2) For i = 0 To UBound(strTemp) - 1 arrRetVal(n) = strTemp(i) & "/" & strTemp(i + 1) If i Mod 2 = 0 Then n = n + 1 End If Next split2 = arrRetVal End Function Private Sub Form_Load() Dim x As String, y() As String, i As Long x = "a/b/c/d/e/f/g/h" y = split2(x, "/") For i = 0 To UBound(y) Debug.Print y(i) Next End Sub




Reply With Quote