Alters the string by removing all occurrences of the patterns.
str="foo bar test"str.remove!(" test",/bar/)# => "foo "str# => "foo "
# File activesupport/lib/active_support/core_ext/string/filters.rb, line 40
def remove!(*patterns)
patterns.each do |pattern|
gsub! pattern, ""
end
self
end