| MATLAB Function Reference | ![]() |
Syntax
Description
str = strrep( replaces all occurrences of the string str1,str2,str3)
str2 within string str1 with the string str3.
strrep( obtained by performing a str1,str2,str3), when any of str1, str2, or str3 is a cell array of
strings, returns a cell array the same size as str1, str2 and str3
strrep using corresponding elements of the inputs. The inputs must all be the same size (or any can be a scalar cell). Any one of the strings can also be a character array with the right number of rows.
Examples
s1 = 'This is a good example.'; str = strrep(s1,'good','great') str = This is a great example. A = 'MATLAB' 'SIMULINK' 'Toolboxes' 'The MathWorks' B = 'Handle Graphics' 'Real Time Workshop' 'Toolboxes' 'The MathWorks' C = 'Signal Processing' 'Image Processing' 'MATLAB' 'SIMULINK' strrep(A,B,C) ans = 'MATLAB' 'SIMULINK' 'MATLAB' 'SIMULINK'
See Also
| strread | strtok | ![]() |