. ( :)
int linesProcessed = 0;
if( linesProcessed % 2 == 1 ){
stdList.Add(line);
}
else{
}
linesProcessed++;
The line linesProcessed % 2 == 1says: take the number of lines that we have already processed and find mod 2this number. (The rest, when you divide this integer by 2.) This will check whether the number of processed rows is even or odd.
If you have not processed any lines, this will be skipped (for example, line 1, your first line.) If you have already processed one line or any odd number of lines, continue and process this current line (for example, line 2.)
If modular math gives you any problems, see the question: fooobar.com/questions/36269 / ...
source
share