// Function to demo erase void eraseDemo(string str) { // Deletes 4 characters from index number 1 str.erase(1, 4); cout << "After erase : "; cout << str; }