Problem

If the word variable contains the string “Bells”, which of the following statements will...

If the word variable contains the string “Bells”, which of the following statements will change the contents of the variable to “Bell”?

a. word.erase(word.length() - 1, 1);

b. word.replace(word.length() – 1, 1, "");

c. word = word.substr(0, word.length() – 1);

d. all of the above

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search