public static boolean containsWhitespace(CharSequence str){
  if (!hasLength(str)) {
    return false;
  }
  int strLen=str.length();
  for (int i=0; i < strLen; i++) {
    if (Character.isWhitespace(str.charAt(i))) {
      return true;
    }
  }
  return false;
}

public static boolean containsWhitespace ( CharSequence str ) { if ( ! hasLength ( str ) ) { return false ; } int strLen = str . length ( ) ; for ( int i = 0 ; i < strLen ; i ++ ) { if ( Character . isWhitespace ( str . charAt ( i ) ) ) { return true ; } } return false ; }
check whether the given charsequence contains any whitespace characters .
