title: Extract common string from two strings with Comma separated
body: <p>I have two strings consisting of several words (Comma separated). If string 1 consisting of words (; separated) which is to be ignored if it presents in string 2, below are the strings</p>
  <pre><code>var compToIgnore=&quot;Samsung,Motorola,Amazon&quot;;
  var allCompanies=&quot;Godrej,Samsung,Videocon,Huawei,Motorola,Alibaba,Amazon&quot;;
  var icm = compToIgnore.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
      
  foreach (var c in listOfCompanies)
  {
      if (c.BrandId.StartsWith(&quot;A2&quot;))
      {
          var item = allCompanies.Where(x =&gt; !icm.Contains(x));
          var result = string.Join(&quot;,&quot;, item);
      }
  }
  </code></pre>
  <p>In result variable I wanted to have final result as <strong>&quot;Godrej,Videocon,Huawei,Alibaba&quot;</strong></p>
  <p>I don't see any proper result with above code</p>