2.1. Setting Up StringUtils and WordUtils
Problem
You want the ability to use
StringUtils
and WordUtils to
manipulate text.
Solution
To download the latest version of Commons Lang, refer to the steps outlined in Recipe 1.1.
Discussion
This chapter focuses on a very small subset of the Commons Lang
project—StringUtils and
WordUtils. To use either
StringUtils or WordUtils in a
Java class, add the following lines to your import statements:
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.WordUtils;
Recipes that use StringUtils and
WordUtils in this chapter will omit these import
statements in code fragments. When StringUtils or
WordUtils appears in an example, assume that it
has already been imported.
See Also
If you have questions about these utilities, join the Jakarta Commons User mailing list; see Recipe 1.2. To download the source for Commons Lang, see Recipe 1.3.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access