blank?()
public
A string is blank if it’s empty or contains whitespaces only:
''.blank?
' '.blank?
"\t\n\r".blank?
' blah '.blank?
Unicode whitespace is supported:
"\u00a0".blank?
@return [true, false]
Show source
def blank?
empty? ||
begin
BLANK_RE.match?(self)
rescue Encoding::CompatibilityError
ENCODED_BLANKS[self.encoding].match?(self)
end
end