Method: String#remove
- Defined in:
- lib/active_support/core_ext/string/filters.rb
permalink #remove(*patterns) ⇒ Object
Returns a new string with all occurrences of the patterns removed.
str = "foo bar test"
str.remove(" test") # => "foo bar"
str.remove(" test", /bar/) # => "foo "
str # => "foo bar test"
32 33 34 |
# File 'lib/active_support/core_ext/string/filters.rb', line 32 def remove(*patterns) dup.remove!(*patterns) end |