Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = in.nextLine();
- if(s != null){
- for(int i = 0; i < s.length(); i++){
- if(Character.isWhitespace(s.charAt(i))){
- sNew = s.replaceAll(" ", "");
- }
- }
- }else if(s == null){
- System.out.println("This string is empty");
- }else{
- sNew = s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement