Strip trailing newline