How to remove the \n, \t and spaces between the Strings in Java

This can be achieved by using the Regular Expressions.


 String sText = "\n Test \t\n";  
 sText= sText.replaceAll("\\s+", "");  

Comments