replace
Replaces strings in another.
📝Syntax
res = replace(str, old, new)
📥Input Arguments
Parameter Description
str a string, string array or cell of strings.
old a string, string array or cell of strings to find.
new a string, string array or cell of strings.
📤Output Arguments
Parameter Description
res a string, string array or cell of strings.
📄Description

replace replaces strings in another.

replace and strrep replace strings but replace is recommended.

💡Examples
r = replace('This is a string.', 'is', 'is not')
r = replace({'cccc','ccbbcca'},{'cc','bb'},{'cc'})
🔗See Also
strrep
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub