diff --git a/doc/string.rb b/doc/string.rb index ad1abf29b7..9ed97d49f6 100644 --- a/doc/string.rb +++ b/doc/string.rb @@ -334,7 +334,7 @@ # _Counts_ # # - #length (aliased as #size): Returns the count of characters (not bytes). -# - #empty?: Returns +true+ if +self.length+ is zero; +false+ otherwise. +# - #empty?: Returns whether the length of +self+ is zero. # - #bytesize: Returns the count of bytes. # - #count: Returns the count of substrings matching given strings. # diff --git a/string.c b/string.c index bd0496f6da..5db6d2e676 100644 --- a/string.c +++ b/string.c @@ -2417,12 +2417,13 @@ rb_str_bytesize(VALUE str) * call-seq: * empty? -> true or false * - * Returns +true+ if the length of +self+ is zero, +false+ otherwise: + * Returns whether the length of +self+ is zero: * - * "hello".empty? # => false - * " ".empty? # => false - * "".empty? # => true + * 'hello'.empty? # => false + * ' '.empty? # => false + * ''.empty? # => true * + * Related: see {Querying}[rdoc-ref:String@Querying]. */ static VALUE