Created
July 15, 2016 23:26
-
-
Save JosiasSena/b3909f70584fcfd39dcff3012bf21074 to your computer and use it in GitHub Desktop.
Removes all white spaces from string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Removes all white spaces from string | |
* | |
* @param text - text to remove white spaces from | |
* @return - text without any whitespaces | |
*/ | |
public static String removeWhiteSpaces(String text) { | |
return text.replaceAll("\\s+", ""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment