 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
• |
For
now, one string operator, concatenation, “+”
|
|
|
• |
Consider
|
|
|
|
string bookTitle;
|
|
|
|
string
phrase1; string phrase2;
|
|
|
|
phrase1 =
“Programming and ”;
|
|
|
|
phrase2 =
“Problem Solving”;
|
|
|
|
bookTitle
= phrase1 + phrase2;
|
|
|
|
bookTitle
has “Programming and Problem Solving” stored
|
|
|
|
bookTitle
= phrase2 + phrase1;
|
|
|
|
bookTitle
now has “Problem SolvingProgramming and ” stored
|
|
Warning: At least one of the operands must
be a string
|
|
|
variable or named constant.
|
|