If the word variable contains the string Bells, which of the following statements will change the contents

Question:

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

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: