mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Documented String#blank?
This commit is contained in:
@@ -85,7 +85,13 @@ class Hash
|
||||
alias_method :blank?, :empty?
|
||||
end
|
||||
|
||||
class String #:nodoc:
|
||||
class String
|
||||
# A string is blank if it's empty or contains whitespaces only
|
||||
# For example:
|
||||
#
|
||||
# "".blank? => true
|
||||
# " ".blank? => true
|
||||
# " something here ".blank? => false
|
||||
def blank?
|
||||
self !~ /\S/
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user