none
Split the variable RRS feed

  • Question

  • I want to divide the variable after - so that each part is placed on a separate textbox

    variable   abdallah-alie-monem-gaber

    textbox1=abdallah  

    textbox2=alie

    textbox3=monem

    textbox4=gaber

    Tuesday, January 16, 2018 7:00 PM

Answers

  • Hi

    Try this:

    	Dim s As String = "abdallah-alie-monem-gaber"
    
    	Dim parts() As String = s.Split("-"c)
    
    	TextBox1.Text = parts(0)
    	TextBox2.Text = parts(1)
    	TextBox3.Text = parts(2)
    	TextBox4.Text = parts(3)
    


    Regards Les, Livingston, Scotland

    • Proposed as answer by Cor Ligthert Tuesday, January 16, 2018 8:00 PM
    • Marked as answer by monemas Tuesday, January 16, 2018 9:45 PM
    Tuesday, January 16, 2018 7:28 PM