Harbor Documentation

String

Parent

Methods

Public Instance Methods

blank?()

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

  "".blank?                 # => true
  "   ".blank?              # => true
  " something here ".blank? # => false
       # File lib/harbor/support/blank.rb, line 118
118:   def blank?
119:     self !~ /\S/
120:   end