instance method
remove
Ruby on Rails 5.2.8.1
Since v4.1.16Signature
remove(*patterns)
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"
Parameters
-
patternsrest
Source
# File activesupport/lib/active_support/core_ext/string/filters.rb, line 32
def remove(*patterns)
dup.remove!(*patterns)
end
Defined in activesupport/lib/active_support/core_ext/string/filters.rb line 32
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String