class String
Extensions to the core String
class
Public Instance Methods
Source
# File lib/rubocop/core_ext/string.rb, line 15 def blank? empty? || lstrip.empty? end
Checks whether a string is blank. A string is considered blank if it is either empty or contains only whitespace characters.
@return [Boolean] true is the string is blank, false otherwise
@example
''.blank? #=> true ' '.blank? #=> true ' test'.blank? #=> false