Java Reference
In-Depth Information
CHAPTER
9
S
TRINGS
Objectives
To use the
String
class to process fixed strings (§9.2).
■
To construct strings (§9.2.1).
■
To understand that strings are immutable and to create an interned
string (§9.2.2).
■
To compare strings (§9.2.3).
■
To get string length and characters, and combine strings (§9.2.4).
■
To obtain substrings (§9.2.5).
■
To convert, replace, and split strings (§9.2.6).
■
To match, replace, and split strings by patterns (§9.2.7).
■
To search for a character or substring in a string (§9.2.8).
■
To convert between a string and an array (§9.2.9).
■
To convert characters and numbers into a string (§9.2.10).
■
To obtain a formatted string (§9.2.11).
■
To check whether a string is a palindrome (§9.3).
■
To convert hexadecimal numbers to decimal numbers (§9.4).
■
To use the
Character
class to process a single character (§9.5).
■
To use the
StringBuilder
and
StringBuffer
classes to process
flexible strings (§9.6).
■
To distinguish among the
String
,
StringBuilder
, and
StringBuffer
classes (§9.2-9.6).
■
To learn how to pass arguments to the
main
method from the
command line (§9.7).
■