title: C# compare 2 files contents for matches
body: <p>I am trying to find a way to compare some text in 2 files and if a match is found then run a process. </p>
  
  <p>Here are examples of the files;</p>
  
  <p><strong>'File A'</strong> = Automated list of text with this format;</p>
  
  <pre><code>example1
  ex2
  289 Example
  fht_nkka
  </code></pre>
  
  <p><strong>'File B'</strong> = File names from a directory search;</p>
  
  <pre><code>example1
  test2
  test4785
  </code></pre>
  
  <p>Using my 2 example files, I want to search them both and find matches.</p>
  
  <p>So 'File A' above contains 'example1' and 'example1' is in 'File B'. What I want to be able to do is create 'string[] match based on all matches. Is there an easy way of doing this?</p>
  
  <p>NOTE: these files do not always have the same line data or amount of lines in.</p>