c++ - Replace part of a string with another string - Stack Overflow
There is a std tag on the question, but perhaps you might be interested in boost's string algorithms, which also includes a wide choice of replace algorithms (inplace/copy, case sensitive/case insensitive, replace first/last/all/n-th). – UncleBens Aug 5 '...