I'm trying to see if my string contains a line from a .txt
This works, but it is reading and showing in the msgbox the next line down from what I want. Also, I don't want it to stop when it hits the first one found. It should keep going until the end of the string.
What's wrong with the code?
Code:Dim objReader As New System.IO.StreamReader(MyTempFilePath) Do While objReader.Peek() <> -1 If editorstring.Contains(objReader.ReadLine) Then MsgBox("String contains: " & objReader.ReadLine) End If Loop




Reply With Quote