by Yuening Dai (30 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 9th January 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Use Function Split in VB6
'see the result.
'See VB help for more detailed info.
'
Private Sub cmdSplit_Click()
'
Dim saTest() As String
Dim sToBeShown As String
Dim I As Integer
'
'
If InStr(1, txtTest.Text, " ") = 0 Then
MsgBox "Type a string with space(s) in it, and try again!"
End If
'
saTest = Split(txtTest.Text, " ", -1, vbTextCompare)
'
For I = 0 To UBound(saTest)
sToBeShown = sToBeShown & saTest(I)
Next I
'
txtTest.Text = sToBeShown
'
End Sub