[DOC] Tweaks for String#empty?

This commit is contained in:
Burdette Lamar 2025-07-23 16:06:44 -05:00 committed by GitHub
parent 78820e86c7
commit e3d36fff8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -334,7 +334,7 @@
# _Counts_ # _Counts_
# #
# - #length (aliased as #size): Returns the count of characters (not bytes). # - #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. # - #bytesize: Returns the count of bytes.
# - #count: Returns the count of substrings matching given strings. # - #count: Returns the count of substrings matching given strings.
# #

View file

@ -2417,12 +2417,13 @@ rb_str_bytesize(VALUE str)
* call-seq: * call-seq:
* empty? -> true or false * 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 * 'hello'.empty? # => false
* " ".empty? # => false * ' '.empty? # => false
* "".empty? # => true * ''.empty? # => true
* *
* Related: see {Querying}[rdoc-ref:String@Querying].
*/ */
static VALUE static VALUE