public static boolean isBlank(String s){
  if (s == null) {
    return true;
  }
  int sLen=s.length();
  for (int i=0; i < sLen; i++) {
    if (!Character.isWhitespace(s.charAt(i))) {
      return false;
    }
  }
  return true;
}

public static boolean isBlank ( String s ) { if ( s == null ) { return true ; } int sLen = s . length ( ) ; for ( int i = 0 ; i < sLen ; i ++ ) { if ( ! Character . isWhitespace ( s . charAt ( i ) ) ) { return false ; } } return true ; }
checks whether a string is whitespace , empty or null .
