#include #include #include #include int main() { std::string s1 { "f9c02b6c9da8943feaea4966ba7417d65de2fe7e" }; std::replace(begin(s1), end(s1), '7', '.'); std::cout << s1 << std::endl; std::string s2 { "f9c02b6c9da8943feaea4966ba7417d65de2fe7e" }; std::replace_if(begin(s2), end(s2), isdigit, '.'); std::cout << s2 << std::endl; const std::string s3 { "f9c02b6c9da8943feaea4966ba7417d65de2fe7e" }; std::string s4 { "........................................" }; std::replace_copy(begin(s3), end(s3), begin(s4), '7', '.'); std::cout << s4 << std::endl; const std::string s5 { "f9c02b6c9da8943feaea4966ba7417d65de2fe7e" }; std::string s6 { "........................................" }; std::replace_copy_if(begin(s5), end(s5), begin(s6), isdigit, '.'); std::cout << s6<< std::endl; }