Given a text and a pattern. Replace all the occurrences of the pattern in the text by another given string.
For Example: If text = “aabaabab” and pattern = “ab”. Then after replacing pattern in the text by “abc” the output should be “aabcaabcabc”.
Given a text and a pattern. Replace all the occurrences of the pattern in the text by another given string.
For Example: If text = “aabaabab” and pattern = “ab”. Then after replacing pattern in the text by “abc” the output should be “aabcaabcabc”.