How to remove Whitespaces from String

 String removeWhiteSpaces(String input){

StringBuilder output = new StringBuilder(); char[] charArray = input.toCharArray(); for(char c : charArray) { if (!Character.isWhitespace(c)) output.append(c); } return output.toString(); }

Comments

Popular posts from this blog

Android - Using KeyStore to encrypt and decrypt the data

Stack and Queue

Java Reflection API