Replacing a string - function strrep:
The function strrep finds all the occurrences of a substring within the string, and substitutes them with a new substring. The order of arguments matters. The format is as sown below:
strrep(string, oldsubstring, newsubstring)
The example below replaces all occurrences of the substring 'e' with the substring 'x':
>> strrep('abcdeabcde','e','x')
ans =
abcdxabcdx
All the strings can be of any length, and the lengths of the old and new substrings do not have to be similar.