Delete specific lines in a text file using vb.net

前端 未结 3 863
太阳男子
太阳男子 2020-12-21 14:37

I am trying to delete some specific lines of a text using VB.Net. I saw a solution here however it is in VB6. The problem is, I am not really familiar with VB6. Can somebody

3条回答
  •  半阙折子戏
    2020-12-21 14:54

        'This can also be the file that you read in
        Dim str As String = "sdfkvjdfkjv" & vbCrLf & "dfsgkjhdfj" & vbCrLf & "dfkjbhhjsdbvcsdhjbvdhs" & vbCrLf & "dfksbvashjcvhjbc"
    
        Dim str2() As String = str.Split(vbCrLf)
    
        For Each s In str2
            If s.Contains("YourString") Then
                'add your line to txtbox
            Else
                'don't add your line to txtbox
            End If
        Next
    

提交回复
热议问题