Skip to content

erase

Remove all occurrences of a pattern from a string.

s = erase(str, match)

Returns str with every occurrence of the substring match removed. Equivalent to strrep(str, match, '').

erase('a-b-c-d', '-') % 'abcd'
  • eraseBetween — Remove the substring between two boundary patterns.
  • strrep — Replace all occurrences of a substring.