diff options
author | Burdette Lamar <[email protected]> | 2024-09-11 12:14:41 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-11 13:14:41 -0400 |
commit | 18fb11aaa407feb6677effb0229a9b82806d8b46 (patch) | |
tree | 3ebb2aed86bd66ccbd67a3883c0785c4a1916924 | |
parent | c7faffd1d6013a840d5286312cd08790c0e0e69a (diff) |
[DOC] Tweaks for Array#difference (#11593)
Notes
Notes:
Merged-By: peterzhu2118 <[email protected]>
-rw-r--r-- | array.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -5521,19 +5521,21 @@ rb_ary_diff(VALUE ary1, VALUE ary2) /* * call-seq: - * array.difference(*other_arrays) -> new_array + * difference(*other_arrays = []) -> new_array * - * Returns a new +Array+ containing only those elements from +self+ - * that are not found in any of the Arrays +other_arrays+; + * Returns a new array containing only those elements from +self+ + * that are not found in any of the given +other_arrays+; * items are compared using <tt>eql?</tt>; order from +self+ is preserved: * * [0, 1, 1, 2, 1, 1, 3, 1, 1].difference([1]) # => [0, 2, 3] - * [0, 1, 2, 3].difference([3, 0], [1, 3]) # => [2] - * [0, 1, 2].difference([4]) # => [0, 1, 2] + * [0, 1, 2, 3].difference([3, 0], [1, 3]) # => [2] + * [0, 1, 2].difference([4]) # => [0, 1, 2] + * [0, 1, 2].difference # => [0, 1, 2] * - * Returns a copy of +self+ if no arguments given. + * Returns a copy of +self+ if no arguments are given. * - * Related: Array#-. + * Related: Array#-; + * see also {Methods for Combining}[rdoc-ref:Array@Methods+for+Combining]. */ static VALUE |