Difference between isNotEmpty and isNotBlank in StringUtils, stringutils. isblank
1. public static boolean isEmpty (String str)
Determines whether a string is null. If it is null, the standard is str = null or str. length () = 0.
The following is an example of StringUtils determining whether it is null:
StringUtils. isEmpty (null) = true
StringUtils. isEmpty ("") = true
StringUtils. isEmpty ("") = false // note that non-empty spaces are processed in StringUtils.
StringUtils. isEmpty ("") = false
StringUtils. isEmpty ("bob") = false
StringUtils. isEmpty ("bob") = false
2. public static boolean isNotEmpty (String str)
Determines whether a string is not null. It is equal! IsEmpty (String str)
The following is an example:
StringUtils. isNotEmpty (null) = false
StringUtils. isNotEmpty ("") = false
StringUtils. isNotEmpty ("") = true
StringUtils. isNotEmpty ("") = true
StringUtils. isNotEmpty ("bob") = true
StringUtils. isNotEmpty ("bob") = true
3. public static boolean isBlank (String str)
Determines whether a string is null or has a length of 0 or is composed of whitespace.
The following is an example:
StringUtils. isBlank (null) = true
StringUtils. isBlank ("") = true
StringUtils. isBlank ("") = true
StringUtils. isBlank ("") = true
StringUtils. isBlank ("\ t \ n \ f \ r") = true // For tabs, line breaks, page breaks, and carriage returns
StringUtils. isBlank () // both are blank characters
StringUtils. isBlank ("\ B") = false // "\ B" is the word boundary.
StringUtils. isBlank ("bob") = false
StringUtils. isBlank ("bob") = false
4. public static boolean isNotBlank (String str)
Determines whether a string is not empty and its length is not 0. It cannot be composed of whitespace. It is equal! IsBlank (String str)
The following is an example:
StringUtils. isNotBlank (null) = false
StringUtils. isNotBlank ("") = false
StringUtils. isNotBlank ("") = false
StringUtils. isNotBlank ("") = false
StringUtils. isNotBlank ("\ t \ n \ f \ r") = false
StringUtils. isNotBlank ("\ B") = true
StringUtils. isNotBlank ("bob") = true
StringUtils. isNotBlank ("bob") = true