The class org.apache.commons.lang3.StringUtils of the Apache Commons library has more than 120 static utility methods that complement those of the class String we described in the previous section.
Among the most popular are the following static methods:
- boolean isBlank(CharSequence cs): returns true when the passed-in parameter is an empty String "", null, or whitespace
- boolean isNotBlank(CharSequence cs): returns true when the passed-in parameter is not an empty String "", null, or whitespace
- boolean isAlpha(CharSequence cs): returns true when the passed-in parameter contains only Unicode letters
- boolean isAlphaSpace(CharSequence cs): returns true when the passed-in parameter contains only Unicode letters and spaces (' ')
- boolean isNumeric(CharSequence cs): returns true when the passed-in parameter contains only digits
- boolean isNumericSpace(CharSequence cs): returns true when the passed-in parameter contains only digits and spaces (' ')
- boolean isAlphaNumeric(CharSequence cs): returns true when the passed-in parameter contains only Unicode letters and digits
- boolean isAlphaNumericSpace(CharSequence cs): returns true when the passed-in parameter contains only Unicode letters, digits, and spaces (' ')
We highly recommend you look through the API of this class and get a feel for what you can find there.