Java replaceAll: How to replace all blank characters in a String
Today I needed a Java method to remove all the blank characters from a String
. I started to write some code with a StringBuffer or a StringBuilder, then thought there must be some other way to do this. It’s not that the StringBuilder/StringBuffer approach is hard, but just that someone must have already solved this problem.