Member Avatar for Mikhaela

hello,
i want to be able to separate the values in a textbox and display the separated values in different labels using a button
this is what i want to happen:
1. input "Ac2O3" on textbox
2. Be able to separate "Ac", "2", "O", and "3".
3. show these separated values in different labels.
im using visual basic 2012
thanks in advance!!

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button5.Click
        Dim str As String = Trim(TextBox1.Text)
        Label1.Text = Mid(str, 1, 2)
        Label2.Text = Mid(str, 3, 1)
        Label3.Text = Mid(str, 4, 1)
        Label4.Text = Mid(str, 5, 1)
    End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.