title: c# - search a string array using strings from another string array
body: <p>Just like in the title. I got one array of strings and second array of strings. I want to display result in this kind of pattern: first element of the first array - then all elements from second array that occurs in first element of first array. After that second element of first array and all elements from second array that occurs in second element of first array. And so on.
  For example:</p>
  
  <pre><code>string[] arrayA = {"Lorem ipsum dolor sit amet, justo", "notgin like good cold beer"};
  string[] arrayB = {"justo","beer","lorem"}
  for (int i = 0; i &lt; arrayA.Length; i++)
     {
        Console.WriteLine(arrayA[i]);
  
         for (int j = 0; j &lt; arrayB.Length; j++)
         {
            int controlIndex = arrayA[i].IndexOf(arrayB[j]);
            if (controlIndex != -1)
            {
                 Console.Write(" :--contains--&gt;" + arrayB[j]);
            }
  
      }
  </code></pre>
  
  <p>}</p>
  
  <p>So the result should looks like this:</p>
  
  <ul>
  <li>Lorem ipsum dolor sit amet, justo :--contains--> <strong>justo,lorem</strong></li>
  <li>notgin like good cold beer :--contains--> <strong>beer</strong>.</li>
  </ul>
  
  <p>But mine result is:
   - Lorem ipsum dolor sit amet, justo :--contains--> <strong><em>justo</em></strong>
   - notgin like good cold beer :--contains--> <strong>beer</strong>.</p>
  
  <p>So as you can see there is no <strong>lorem listed</strong></p>