How do you remove the \\n, \\t and spaces between strings in java?
str.replaceAll("\\s+", "");
\s A whitespace character: [ \t\n\x0B\f\r]
java.util.regex.Pattern has all the predefined classes.
Use String.replaceAll with a regular expression to remove all whitespace:
s = s.replaceAll("\\s+", "");