StringUtils in Commons-lang-2.2.jar bag: org.apache.commons.lang.StringUtils;
The action object of the StringUtils method is an object of type java.lang.String, a supplement to the string manipulation method provided by the JDK, and Null is safe ( That is, if the input parameter string is NULL, the NullPointerException is not thrown, but the corresponding processing is done, for example, if the input is null, the return is NULL, etc., you can view the source code.
In addition to the constructor, there are more than 130 methods in StringUtils, and all are static, so we can call Stringutils.xxx ()
1. public static Boolean IsEmpty (String str)
The criterion for determining whether a string is empty is Str==null or str.length () ==0
The following is an example of whether StringUtils is empty:
Stringutils.isempty (NULL) = True
Stringutils.isempty ("") = True
Stringutils.isempty ("") = false//note in StringUtils Hollow space for non-null processing
Stringutils.isempty ("Bob") = False
Stringutils.isempty ("Bob") = False
2. public static Boolean isnotempty (String str)
Determines whether a string is non-null, equal to!isempty (string str)
Here is an example:
Stringutils.isnotempty (NULL) = False
Stringutils.isnotempty ("") = False
Stringutils.isnotempty ("") = True
Stringutils.isnotempty ("Bob") = True
Stringutils.isnotempty ("Bob") = True
3. public static Boolean IsBlank (String str)
Determines whether a string is empty or length 0 or is composed of a blank character (whitespace)
Here is an example:
Stringutils.isblank (NULL) = True
Stringutils.isblank ("") = True
Stringutils.isblank ("") = True
Stringutils.isblank ("\ \ \ n \f \ r") = TRUE//is known as a blank character for tabs, line breaks, feed and return Stringutils.isblank ()
Stringutils.isblank ("\b") = false//"\b" for word boundary character
Stringutils.isblank ("Bob") = False
Stringutils.isblank ("Bob") = False
4. public static Boolean Isnotblank (String str)
Determines whether a string is not empty and has a length of 0 and is not composed of whitespace characters (whitespace) equal to!isblank (string str)
Here is an example:
Stringutils.isnotblank (NULL) = False
Stringutils.isnotblank ("") = False
Stringutils.isnotblank ("") = False
Stringutils.isnotblank ("\ \ n \f \ r") = False
Stringutils.isnotblank ("\b") = true
Stringutils.isnotblank ("Bob") = True
Stringutils.isnotblank ("Bob") = True