Exer. 1.18 removes new line

does not remove spaces or tabs at end