mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[DOC] Tweaks for String#empty?
This commit is contained in:
parent
78820e86c7
commit
e3d36fff8f
2 changed files with 6 additions and 5 deletions
|
@ -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.
|
||||
#
|
||||
|
|
9
string.c
9
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue