std::string replace(const std::string& in, const std::string& from, const std::string& to)
{
std::string out = in;
std::size_t pos = 0;
while ((pos = out.find(from, pos)) != std::string::npos)
{
out.replace(pos, from.length(), to);
pos += to.length();
}...