Fajar Ahmas Ahmas
Fajar Ahmas Ahmas

Reputation: 19

Remove a line contains something in VB.Net

in that case how can I change this line to be "" or delete it?

 For Each Line As String In TxtListScanTxt.Lines
            If (Line.Contains("{ LstScan = , DrwR2 = 0000000000 }")) Then
                Line.Remove(Line)
            End If
        Next

Upvotes: 0

Views: 126

Answers (1)

GSerg
GSerg

Reputation: 78185

TxtListScanTxt.Lines = TxtListScanTxt.Lines.Where( _
    Function(line) Not line.Contains("{ LstScan = , DrwR2 = 0000000000 }") _
).ToArray()

Upvotes: 1

Related Questions