I want to split a string that contains words and spaces and punctuation, but I want every character in the string to have its own place in the array. I tried putting in a zero length delimeter, but that didn't work.
Public Function mySplit(strString As String) As String()
Dim counter As Integer
Dim intLength As Integer
intLength = Len(strString)
Dim tempArray() As String
ReDim tempArray(1 To intLength) As String
ReDim mySplit(1 To intLength)
For counter = 1 To intLength
tempArray(counter) = Mid(strString, counter, 1)
Next counter
mySplit = tempArray
End Function
Public Sub testSplit()
Dim tempArray() As String
tempArray = mySplit("xyzABC")
MsgBox tempArray(1)
MsgBox tempArray(6)
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.