strrep
Replace all occurrences of a substring.
Syntax
Section titled “Syntax”s = strrep(str1, str2, str3)Description
Section titled “Description”Returns str1 with every occurrence of the substring str2 replaced by str3. Replacements are made left-to-right; once a match is replaced, scanning continues after the replacement (no re-matching of inserted text).
Examples
Section titled “Examples”strrep('hello world', 'world', 'there') % 'hello there'strrep('a-b-c-d', '-', '_') % 'a_b_c_d'