Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- std::string replaceStr(std::string str, std::string oldVal, std::string newVal)
- {
- while (str.find(oldVal) != std::string::npos)
- {
- str.replace(str.find(oldVal), oldVal.length(), newVal);
- }
- return str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement