class String

Add blank? method to String class.

Public Instance Methods

blank?() click to toggle source

Strips out whitespace then tests if the string is empty.

"".blank?         #=>  true
"     ".blank?    #=>  true
" hey ho ".blank? #=>  false

@return [TrueClass, FalseClass]

# File lib/croesus/core_ext/blank.rb, line 105
def blank?
  strip.empty?
end