[DOC] Tweaks for Array#drop_while
This commit is contained in:
parent
1be9a99837
commit
c7faffd1d6
Notes:
git
2024-09-11 17:14:26 +00:00
15
array.c
15
array.c
@ -7731,23 +7731,20 @@ rb_ary_drop(VALUE ary, VALUE n)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* array.drop_while {|element| ... } -> new_array
|
* drop_while {|element| ... } -> new_array
|
||||||
* array.drop_while -> new_enumerator
|
* drop_while -> new_enumerator
|
||||||
|
|
||||||
* Returns a new +Array+ containing zero or more trailing elements of +self+;
|
|
||||||
* does not modify +self+.
|
|
||||||
*
|
*
|
||||||
* With a block given, calls the block with each successive element of +self+;
|
* With a block given, calls the block with each successive element of +self+;
|
||||||
* stops if the block returns +false+ or +nil+;
|
* stops if the block returns +false+ or +nil+;
|
||||||
* returns a new +Array+ _omitting_ those elements for which the block returned a truthy value:
|
* returns a new array _omitting_ those elements for which the block returned a truthy value;
|
||||||
|
* does not modify +self+:
|
||||||
*
|
*
|
||||||
* a = [0, 1, 2, 3, 4, 5]
|
* a = [0, 1, 2, 3, 4, 5]
|
||||||
* a.drop_while {|element| element < 3 } # => [3, 4, 5]
|
* a.drop_while {|element| element < 3 } # => [3, 4, 5]
|
||||||
*
|
*
|
||||||
* With no block given, returns a new Enumerator:
|
* With no block given, returns a new Enumerator.
|
||||||
*
|
|
||||||
* [0, 1].drop_while # => # => #<Enumerator: [0, 1]:drop_while>
|
|
||||||
*
|
*
|
||||||
|
* Related: see {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user