I am trying to split a string "Surname Forename Occupation" taken from a ListBox so I can put the first word into a text box. Using Split I can display in a message box but get errors trying to load into a textbox. It started out as a string but seems to be an array. I need the string to trim down to just the Surname.
HTML Code:
Dim str As String = Me.ListBox3.SelectedItem
Dim strarr() As String
strarr = str.Split(" "c)
For Each s As String In strarr
MessageBox.Show(s)
Next
Me.TextBox1.Text = strarr