📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 03:04:19
📂
/ (Root)
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Array
📍 /opt/alt/ruby27/share/ri/system/Array
🔄 Refresh
✏️
Editing: difference-i.ri
Read Only
U:RDoc::AnyMethod[iI"difference:ETI"Array#difference;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"Array Difference;To:RDoc::Markup::BlankLine o; ; [I"LReturns a new array that is a copy of the original array, removing all ;TI"Koccurrences of any item that also appear in +other_ary+. The order is ;TI"'preserved from the original array.;T@o; ; [I"MIt compares elements using their #hash and #eql? methods for efficiency.;T@o:RDoc::Markup::Verbatim; [I"L[ 1, 1, 2, 2, 3, 3, 4, 5 ].difference([ 1, 2, 4 ]) #=> [ 3, 3, 5 ] ;T:@format0o; ; [I"ONote that while 1 and 2 were only present once in the array argument, and ;TI"Swere present twice in the receiver array, all occurrences of each Integer are ;TI"#removed in the returned array.;T@o; ; [I"QMultiple array arguments can be supplied and all occurrences of any element ;TI"Oin those supplied arrays that match the receiver will be removed from the ;TI"returned array.;T@o;; [I"N[ 1, 'c', :s, 'yep' ].difference([ 1 ], [ 'a', 'c' ]) #=> [ :s, "yep" ] ;T; 0o; ; [I">If you need set-like behavior, see the library class Set.;T@o; ; [I"See also Array#-.;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I">ary.difference(other_ary1, other_ary2, ...) -> new_ary ;T0[ I"(*args);T@-FI" Array;TcRDoc::NormalClass00
💾 Save Changes
❌ Cancel