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()
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
3.45 Rating (164 Votes )
There are 3 Steps involved in it
d Al... View full answer
Get step-by-step solutions from verified subject matter experts
