Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16017

VS 2013 [RESOLVED] Split string to put first word into a text box

$
0
0
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


Viewing all articles
Browse latest Browse all 16017

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>