hi pappy,
when the user press enter button, Line feed and carriage return are added to the textbox string.
so we can check whether the character is equal to Line feed or carriage return. If it is, we simply exclude the characters not to be added to list box.
here is the code with modified syntax.
Private Sub Command1_Click()
Dim str As String
Dim char As String
List1.Clear 'ListBox used for displaying splitten characters.
str = Text1.Text 'TextBox used for getting i/p string
For i = 1 To Len(str) Step 1
char = Mid(str, i, 1)
If char <> " " And char <> vbLf And char <> vbCr Then 'Modified code
List1.AddItem char
End If
Next i
End Sub
have a nice time.
bye.