Section: String Functions
p = strrep(source,find,replace)
Every instance of the string find in the string source is
replaced with the string replace. Any of source, find
and replace can be a cell array of strings, in which case
each entry has the replace operation applied.
strrep. First the case
where are the arguments are simple strings
--> strrep('Matlab is great','Matlab','FreeMat')
ans =
<string> - size: [1 16]
FreeMat is great
And here we have the replace operation for a number of strings:
--> strrep({'time is money';'A stitch in time';'No time for games'},'time','money')
ans =
<cell array> - size: [3 1]
Columns 1 to 1
money is money
A stitch in money
No money for games