Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

merge two lists together ruby

# Merging
c = a + b
 => [1, 2, 3, 4, 5, 2, 4, 6]
# Removing the value of other array
# (a & b) is getting the common element from these two arrays
c - (a & b)
=> [1, 3, 5, 6]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #merge #lists #ruby
ADD COMMENT
Topic
Name
2+8 =