string & erase(int pos = 0, int n = string::npos);This function simply erases a sequence of characters from index pos, inclusively, over n characters or until the end of the string, whichever comes first.
string a = "Michael is not everyone’s friend"; a.erase(11, 4); /* a is “Michael is everyone’s friend” */You got that right! I am Michael and I am everybody’s friend!