I have a string from which I need to remove all of the newlines, tabs, and spaces. Here is the code I wrote:
It removes the spaces just fine but not the newlines or tabs. How can I do this?
Thanks for the help!
The main reason it isn't working is because String.replaceAll(String, String) uses a regex for the first string and not just a pattern. If you change your code to the following: