Advertisement
gdog2u

Untitled

Feb 3rd, 2014
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1.         s = in.nextLine();
  2.         if(s != null){
  3.             for(int i = 0; i < s.length(); i++){
  4.                 if(Character.isWhitespace(s.charAt(i))){
  5.                     sNew = s.replaceAll(" ", "");
  6.                 }
  7.             }
  8.         }else if(s == null){
  9.             System.out.println("This string is empty");
  10.         }else{
  11.             sNew = s;
  12.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement