Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27379

VS 2010 Splitting One line of Text into 6 different fields and vice versa

$
0
0
I am trying to write some code that will split a single line of text into 6 different text fields, like An Address. I have started and think I understand the concept. I assume I need to take the text and write code that will take the text separated by a comma and put each section into an array using a counter. Then output it to fieldX with X being the counter to automatically move to the next spot in the array. Now as far as bringing it back from the fields to one text I am clueless. I know you can add items to a list box but can you add items to a text box the same way? Here is my code so far. Thanks again for any help.

Code:

    Private Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button4.Click
        txtsentence.Text = BreakApart(txtsentence.Text)
    End Sub

    Function BreakApart(ByVal s As String) As String
        Dim s As String
        s = "Chilkat Mail, ActiveX Component, $99, free upgrades, 1-Year Support"

        Dim txtsentence(5) As String

        txtsentence() = Split(, ",")

        For i = 0 To UBound(txtsentence)

            txtField1()

            ***************(Trim$(txtsentence(i)))
        Next
    End Function


Viewing all articles
Browse latest Browse all 27379

Trending Articles



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