14 Strings, Characters and
Regular Expressions
Objectives
In this chapter you’ll:
Create and manipulate
Self-Review Exercises 2
Self-Review Exercises
14.1 State whether each of the following is true or false. If false, explain why.
a) When String objects are compared using ==, the result is true if the Strings contain
the same values.
b) A String can be modified after it’s created.
14.2 For each of the following, write a single statement that performs the indicated task:
a) Compare the string in s1 to the string in s2 for equality of contents.
b) Append the string s2 to the string s1, using +=.
Exercises
NOTE: Solutions to the programming exercises are located in the ch14solutions folder.
Each exercise has its own folder named ex14_## where ## is a two-digit number represent-
ing the exercise number. For example, exercise 14.3’s solution is located in the folder
ex14_03.
© 2018 Pearson Education, Inc., 330 Hudson Street, NY NY 10013. All rights reserved.