PREV INDEX NEXT

Author: Unknown
Subject: remove trailing newlines
Date: Monday, 23 Mar 2020, 09:01:58

1. Does trailing newlines refer to the newline character after each line? Or does it refer to newlines at the end of a file? (for example, if a file has 10 lines in total: 2 non-empty lines, and 8 empty lines, do we ignore the last 8 newline characters? or do we treat them as proper lines?)

2. If a file ends with a newline, should the last empty line be treated as a line?

3. What is the point of removing trailing newlines? Can't we just process each line with the last character as a newline?
PREV INDEX NEXT