|
-
Sep 6th, 2010, 11:27 AM
#1
Thread Starter
New Member
Splitting Text from a TextBox into an Array
Hi all,
I'm hoping some of you can help me.
Im writing a program where im trying to split some text imported from a textfile into a textbox into an array.
The array is undefined and i would like each piece of text to be an element in the array. I would then like to sort this information into alphabetical order.
This is the code I have at present; I apologise if any appears to be out of sequence or whatever, VB is a rather puzzling language to myself!
PS i have the code behind a button as you can tell from the code.
Thank you all for your time and patience.
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim textInput As String
textInput = TextBox1.Text
Dim textArray() As String = TextBox1.Text.Split(","c)
Array.Sort(textArray)
Dim i As Integer
For i = LBound(textArray) To UBound(textArray)
TextBox2.Text = (textInput)
Next
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|