[DOC] Tweaks to Array#- (#11303)
This commit is contained in:
parent
2a31410ebe
commit
3719b3d74d
Notes:
git
2024-08-07 20:00:17 +00:00
Merged-By: peterzhu2118 <peter@peterzhu.ca>
16
array.c
16
array.c
@ -5408,16 +5408,18 @@ ary_make_hash_by(VALUE ary)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* array - other_array -> new_array
|
* self - other_array -> new_array
|
||||||
*
|
*
|
||||||
* Returns a new +Array+ containing only those elements from +array+
|
* Returns a new array containing only those elements of +self+
|
||||||
* that are not found in +Array+ +other_array+;
|
* that are not found in +other_array+;
|
||||||
* items are compared using <tt>eql?</tt>;
|
* the order from +self+ is preserved:
|
||||||
* the order from +array+ is preserved:
|
|
||||||
*
|
*
|
||||||
* [0, 1, 1, 2, 1, 1, 3, 1, 1] - [1] # => [0, 2, 3]
|
* [0, 1, 1, 2, 1, 1, 3, 1, 1] - [1] # => [0, 2, 3]
|
||||||
* [0, 1, 2, 3] - [3, 0] # => [1, 2]
|
* [0, 1, 1, 2, 1, 1, 3, 1, 1] - [3, 2, 0, :foo] # => [1, 1, 1, 1, 1, 1]
|
||||||
* [0, 1, 2] - [4] # => [0, 1, 2]
|
* [0, 1, 2] - [:foo] # => [0, 1, 2]
|
||||||
|
*
|
||||||
|
* Element are compared using method <tt>#eql?</tt>
|
||||||
|
* (as defined in each element of +self+).
|
||||||
*
|
*
|
||||||
* Related: Array#difference.
|
* Related: Array#difference.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user