Exercise1-19. Reverse a line string