title: How to check if an element in an array exists in another array
body: <p>I have two different arrays of strings, <code>array1</code> and <code>array2</code>, in which I want to find out if the elements in <code>array1</code> also exist in <code>array2</code> without modifying the elements in <code>array1</code>, but the values in <code>array1</code> include the extra characters including and after the colon <code>:</code>.</p>
  
  <pre><code>array1 = ["unit 1 : Unit 1","unit 2 : Unit 2","unit 3 : Unit 3","test : Test", "system1"]
  array2 = ["unit 1","unit 2","unit 3","test"]
  </code></pre>
  
  <p>I tried using  <code>include?</code> but it doesn't work.</p>
  
  <pre><code>array1.each do |element|
      #see if element exists in array 2
      if array2.include? element
           #print the name of that element
           puts element
      end
  end
  </code></pre>
  
  <p>How would I approach this?</p>