Loading




2.1. Setting Up StringUtils and WordUtils

2.1. Setting Up StringUtils and WordUtils

2.1.1. Problem

You want the ability to use StringUtils and WordUtils to manipulate text.

2.1.2. Solution

To download the latest version of Commons Lang, refer to the steps outlined in Recipe 1.1.

2.1.3. 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.