replacing a string - function strrepthe function


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.

 

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: replacing a string - function strrepthe function
Reference No:- TGS0175086

Expected delivery within 24 Hours