Question: C++ string replace_all(const string & original_string, const string & old_substring, const string & new_substring); . A function called replace_all that accepts two string arguments, old_substring,
C++
string replace_all(const string & original_string, const string & old_substring, const string & new_substring);
. A function called replace_all that accepts two string arguments, old_substring, new_substring, and original_string. The function will return a copy of string original_string with each occurrence of old_substring replace by new_substring. original_string is not changed. For example is original_string = aaabbacceeaaa, old_substring = aa, and new_substring = zzz, the function will return the string zzzabbacceezzza.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
