instance method
squish!
Ruby on Rails 4.1.16
Since v3.0.20Signature
squish!()
Performs a destructive squish. See String#squish.
Source
# File activesupport/lib/active_support/core_ext/string/filters.rb, line 16
def squish!
gsub!(/\A[[:space:]]+/, '')
gsub!(/[[:space:]]+\z/, '')
gsub!(/[[:space:]]+/, ' ')
self
end
Defined in activesupport/lib/active_support/core_ext/string/filters.rb line 16
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in String