// pgm34 // using the C++ string class: erase, replace, insert // these functions allow you to modify a string // 11/23/2016 #include #include #include #include #include using namespace std; int main() // string::erase { string sentence = "My inkjet printer is not working"; cout << "Original sentence is: " << sentence << endl; sentence.replace(3, 6, "laser"); cout << "sentences is now: " << sentence << endl; sentence.erase(19, 4); cout << "sentences is now: " << sentence << endl; sentence.insert(sentence.length(), "!!!"); cout << "sentences is now: " << sentence << endl; return 0; }