Answer the question
In order to leave comments, you need to log in
How in Ruby from two arrays it is possible to display non-matching values?
I can't solve this problem at all.
The fact is that, for example, there are arrays:
list = [101,102,103,104,105]
list2 = [101,102,103]
Answer the question
In order to leave comments, you need to log in
list = [101,102,103,104,105]
=> [101, 102, 103, 104, 105]
list2 = [101,102,103]
=> [101, 102, 103]
(list-list2) | (list2-list)
=> [104, 105]
lmgtfy:
ruby-doc.org/core-2.2.0/Array.html#2D-method
grosser.it/2011/07/07/ruby-array-diffother-differe...
stackoverflow.com/questions/80091/diff -a-ruby-stri...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question