title: Match elements between 2 collections with Linq in c#
body: <p>i have a question about how to do a common programming task in linq.</p>
  
  <p>lets say we have do different collections or arrays. What i would like to do is match elements between arrays and if there is a match then do something with that element.</p>
  
  <p>eg:</p>
  
  <pre><code>        string[] collection1 = new string[] { "1", "7", "4" };
          string[] collection2 = new string[] { "6", "1", "7" };
  
          foreach (string str1 in collection1)
          {
              foreach (string str2 in collection2)
              {
                  if (str1 == str2)
                  {
                      // DO SOMETHING EXCITING///
                  }
              }
          }
  </code></pre>
  
  <p>This can obviously be accomplished using the code above but what i am wondering if there is a fast and neat way you can do this with LinqtoObjects?</p>
  
  <p>Thanks!</p>