Write a function named replaceSubstring. The function should accept three C-stri
ID: 3621418 • Letter: W
Question
Write a function named replaceSubstring. The function should accept three C-string or string object arguments. Let's call them string1, string2, and string3. It should search for string1 for all occurences of string2. When it finds an occurence of string2, it should replace it with string3. For example, suppose the three arguments have the following values:string1: "the dog jumped over the fence"
string2: "the"
string3: "that"
With these three arguments, the function would return a string object with the value "that dog jumped over that fence." Demonstrate the function in a complete program.