strip extra characters from begenning and ends of lines when egenerating messages.