But that didn't work at all, I just get this error message:
1 2
error: no matching function for call to 'std::__cxx11::basic_string<char>::replace(int, std::__cxx11::basic_string<char>::size_type, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
example1.replace(0, example2[1]);
loop over string calling a transform() that calls your lambda that may call replace (or not for numbers) on a per-letter basis would probably work if you wanted to go that route. Or maybe replace-if without the lambda?