Click here to Skip to main content
16,016,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i wanted to put the textbox number in the listbox like this.

testbox2
1-4-5-7-9


to this....


listbox2
1
4
5
7
9

i hope you can help me
thank you,
Posted

1 solution

VB
Dim str As String = TextBox.Text;

Dim arr As String() = str.Split(New Char() {"-"})
Dim i As Integer
For i = 0 To arr.Length - 1
     ListBox1.Items.Add(arr(i))
Next i
 
Share this answer
 
v2
Comments
Member 10791395 11-Sep-14 5:32am    
the first number is missing..
Gihan Liyanage 11-Sep-14 5:50am    
If you got the correct answer, its great if you can click on Accept answer Button, then when some other person search the question, he also know, this is the correct answer
Gihan Liyanage 11-Sep-14 5:46am    
use i=0, I have edited it .
Member 10791395 11-Sep-14 5:55am    
wow, thank you so much..
Gihan Liyanage 11-Sep-14 6:01am    
You are welcome dude.. and thanx for mark it as an answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900