You can skip a line by just not doing anything with it. Quickest way, use continue;
...
while (!sr.EndOfStream)
{
string line = sr.ReadLine();
if (line.StartsWith("0"))
{
continue;
}
//process line logic
}
Using continue
will effectively jump to the start of the while
loop again, which will then proceed to reading the next line,
This is based on my understanding that you want to skip lines that start with "0"