replace
Replace a portion of a string at a specific position.
Syntax
Section titled “Syntax”v = replace(old_text, start_num, num_chars, new_text)Description
Section titled “Description”Returns old_text with the substring of length num_chars starting at position start_num replaced by new_text. To replace based on the content of a substring rather than position, use substitute or strrep.
Example
Section titled “Example”replace('hello world', 7, 5, 'there') % 'hello there'See also
Section titled “See also”substitute— Replace text by content (substring matching).strrep— Replace all occurrences of a substring.