Delete using iterators string The character at the specified position in !
string str = "huehfudhfruhgfsfgkhdyfsghydff"; string::iterator itr =
str.begin(); itr += 2; str.erase(itr);
Delete with subscript string The character at the specified position in !
string s = "dyegyswdgcgshjdcfgsd"; s.erase(5,1); // Delete the subscript as 5 Elements of ! cout << s <<
endl; // output : //dyegywdgcgshjdcfgsd
 

delete string All characters specified in !
str.erase(std::remove(str.begin(), str.end(), 'e'), str.end());