Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13
|
#include <string>
#include <iostream>
#include <algorithm> //Not part of string, use "algorithms" replace()
int main()
{
std::string str("apple");
std::replace(str.begin(), str.end(), 'p', 'q'); //global function
std::cout << str;
std::cin.ignore();
return 0;
}
|
Last edited on
Got it. Thank you very much guys!