#include <algorithm>
#include <iostream>
#include <string>
int main()
{
std::string s("this is a test");
std::replace(s.begin(), s.end(), ' ', '_');
std::cout << s << '\n';
}
What is a nice STL template algorithm to replace each occurrence of some
particular value with some other value in an arbitrary sequence? What do
you think it might be called?
--
Richard Herring