How do I use StringUtils in Java?
java.lang
does not contain a class called StringUtils
. Several third-party libs do, such as Apache Commons Lang or the Spring framework. Make sure you have the relevant jar in your project classpath and import the correct class.
StringUtils is an Apache Commons project. You need to download and add the library to your classpath.
To use:
import org.apache.commons.lang3.StringUtils;