How can i remove the first line of a textbox on a button press?
Try this :
Dim b As String() = Split(TextBox1.Text, vbNewLine)
TextBox1.Text = String.Join(vbNewLine, b, 1, b.Length - 1)
See String.Join for reference .
fairly easy:
Private Sub bttnFirstLine_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bttnFirstLine.Click
txtBox.Text = txtBox.Text.Substring(txtBox.Text.IndexOf(vbCrLf))
end sub
or
Private Sub bttnFirstLine_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bttnFirstLine.Click
dim myString = txtBox.text
txtBox.Text = myString.Substring(myString.IndexOf(vbCrLf))
end sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With