instance method
remove!
Ruby on Rails 6.0.6
Since v4.1.16Signature
remove!(*patterns)
Alters the string by removing all occurrences of the patterns.
str = "foo bar test" str.remove!(" test", /bar/) # => "foo " str # => "foo "
Parameters
-
patternsrest
Source
# File activesupport/lib/active_support/core_ext/string/filters.rb, line 40
def remove!(*patterns)
patterns.each do |pattern|
gsub! pattern, ""
end
self
end
Defined in activesupport/lib/active_support/core_ext/string/filters.rb line 40
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String