VB如何除去TextBox中每行文本“——”前的数据,要全部文本中删去哦
2个回答
展开全部
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim AllLine() As String = TextBox1.Text.Split(vbCrLf)
TextBox1.Text = ""
For i As Integer = 0 To UBound(AllLine)
Dim AllText() As String = AllLine(i).Split("——")
TextBox1.AppendText(AllText(2))
If i <> UBound(AllLine) Then TextBox1.AppendText(vbCrLf)
Next
End Sub
Dim AllLine() As String = TextBox1.Text.Split(vbCrLf)
TextBox1.Text = ""
For i As Integer = 0 To UBound(AllLine)
Dim AllText() As String = AllLine(i).Split("——")
TextBox1.AppendText(AllText(2))
If i <> UBound(AllLine) Then TextBox1.AppendText(vbCrLf)
Next
End Sub
追问
亲,有木有VB6的代码
追答
除了按钮事件,中间部分的不是跟vb6的差不多嘛,哪句不能通过?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询