java doc added.
new method that removes new line characters.