Class: String

Inherits:
Object show all
Defined in:
lib/fission.old/core_ext/object.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

A string is blank if it's empty or contains whitespaces only:

"".blank?                 # => true
"   ".blank?              # => true
" something here ".blank? # => false

Returns:

  • (Boolean)

98
99
100
# File 'lib/fission.old/core_ext/object.rb', line 98

def blank?
  self !~ /\S/
end