Link to home
Start Free TrialLog in
Avatar of Brian
BrianFlag for United States of America

asked on

Loop while string is not empty or null

I have the following loop that I want to continue until every line in SR (StreamReader) has been read and outputted. What condition should I add to the Do While Loop to have it read all the lines?

        Do While (strLine ???)            
            strLine = SR.ReadLine                               '// Read in line
            If strLine Is Nothing Then
                MessageBox.Show("Unable to extra data, please try again. If it continues to fail, please contact Brian L.")
                Exit Sub
            End If
            '// Output line when it contains useful info
            If strLine.Contains("Gi") Then
            End If

Open in new window

Avatar of Darrell Porter
Darrell Porter
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brian


Perfect... thanks!