public static boolean isEmptyOrBlanks(String string){
  if (string == null || string.length() == 0) {
    return true;
  }
  for (int i=0; i < string.length(); i++) {
    char c=string.charAt(i);
    if (!Character.isWhitespace(c)) {
      return false;
    }
  }
  return true;
}

public static boolean isEmptyOrBlanks ( String string ) { if ( string == null || string . length ( ) == 0 ) { return true ; } for ( int i = 0 ; i < string . length ( ) ; i ++ ) { char c = string . charAt ( i ) ; if ( ! Character . isWhitespace ( c ) ) { return false ; } } return true ; }
checks if the given string is null , empty or contains whitespace only
