How does the bolded red line below do what it does in detecting the EOF of the text file?
Coming from a VBA background I'm slightly confused.
I understand the readline assigns to my string field (data) but how is the not equal to null functioning?
I tested and has nothing to do with being a blank row.
Thanks.
using (StreamReader sr = new StreamReader(args[0]))
{
string data =null;
// Assumes all rows are populated
while ((data=sr.ReadLine()) !=null) {
iRows++;
Console.WriteLine(iRows + " - " + data);
}
}
Coming from a VBA background I'm slightly confused.
I understand the readline assigns to my string field (data) but how is the not equal to null functioning?
I tested and has nothing to do with being a blank row.
Thanks.
using (StreamReader sr = new StreamReader(args[0]))
{
string data =null;
// Assumes all rows are populated
while ((data=sr.ReadLine()) !=null) {
iRows++;
Console.WriteLine(iRows + " - " + data);
}
}
Comment