I have a string with value ""123|abc|456|" separated by vertical bar. I want to create a sub that reads upto "|" and then exits the sub.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myString As String = "123|abc|456|"
For Each character In myString
If character <> "|" Then
TextBox1.Text += character
End If
Next
End Sub
My output looks like this 123abc456, which is not what I am looking for. How do you do this with Do While, and stop the loop when it encounters the vertical bar "|"? Many thanks.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myString As String = "123|abc|456|"
For Each character In myString
If character <> "|" Then
TextBox1.Text += character
End If
Next
End Sub
My output looks like this 123abc456, which is not what I am looking for. How do you do this with Do While, and stop the loop when it encounters the vertical bar "|"? Many thanks.