Remove new line character from the last line.