// Illustrating the generic replace algorithm. #include #include #include #include int main() { vector vecChar = string("FERRARI"); // Replace all occurrences of R by S: replace(vecChar.begin(), vecChar.end(), 'R', 'S'); assert(string(vecChar) == string("FESSASI")); }