Define a function called ReplaceAll, the idea of which is to search the text for a specific part (word or phrase) and replace it with another part.
When summoning her, we must pass three texts to her. The first represents a regular text, the second represents the component we want to search for, and the third represents the component we want to place in place of the second part.
In the end, a copy of the first text should be returned after the part we searched for has been replaced by the part we want to place it in.
Then try this function in the program.
Example: Using the ReplaceAll () function we can replace every word "cat" in the text "I like cats. I have one cat." In the word "dog" and then you will return to us the text "I like dogs. I have one dog."
from :harmash.com