java 8 remove spaces from string

Java
a.replaceAll("\\s+","");
Source

Also in Java: