Guest User

Untitled

a guest
Mar 6th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. list_one =<<END
  2. foo@example.org
  3. bar@example.org
  4. baz@example.org
  5. qux@example.org
  6. ham@example.org
  7. ham@example.org
  8. END
  9.  
  10.  
  11. list_two =<<END
  12. foo@example.org
  13. bar@example.com
  14. baz@example.com
  15. qux@example.com
  16. ham@example.com
  17. ham@example.com
  18. END
  19.  
  20.  
  21. def merge str1, str2
  22. (str1+str2).split.uniq
  23. end
  24.  
  25.  
  26. puts merge(list_one, list_two).join("\n")
Add Comment
Please, Sign In to add comment