Hi all.
If I have a multi-line textbox like this:
----
Line 1
Line 1
Line 1
Line 2
Line 2
Line 3
----
How do I remove lines that are the same as the line above?
This is my code:
vb.net Code:
For i = 0 To txtTextResult.Lines.Count - 1 Dim sLine As String sLine = txtTextResult.Lines(i) Try Dim sNextLine As String = txtTextResult.Lines(i + 1) If sNextLine = sLine Then 'Remove txtTextResult.Lines(i + 1) End If Catch : Exit For : End Try 'When sLine is the last line, sNextLine can't be the line under it. Next
I've already tried many things.
For example, this, which is not working:
vb.net Code:
txtTextResult.Lines(i + 1).Remove(0) 'Remove ( startindex as integer)
Thanks.




Reply With Quote
