Look at the example code here. Scroll down and you will see the code snippet for testing for and removing the new line character. This can be applied for any character.