title: search through a List with a Comma separated string
body: <pre><code>I have a comma separated string FacultyList="1,2,3,4...1004,1005..."
  </code></pre>
  
  <p>Then there is a List of applicants of type "InitialApplicantModel". FacultyList is a property of InitialApplicantModel.</p>
  
  <pre><code>public class InitialApplicantModel
  {
    public int applicantID {get;set}
    public string FacultyList {get; set;}
  }
  </code></pre>
  
  <p>I want to get a list of applicants where their FacultyList contains the value 4.</p>
  
  <blockquote>
    <p>EX: applicantID 1 has the FacultyList=1,2,30,4,..100 / applicantID 2 has
    the FacultyList=200,301,.... / applicant 3 has the
    FacultyList=101,2,31,4,..110</p>
  </blockquote>
  
  <p>So the final list should return applicant 1 and 3.</p>
  
  <p>I tried the code below but doesn't seem to return the correct result.</p>
  
  <pre><code>foreach (InitialApplicantModel item in applicants)
  {
      if (item.FacultyList != null)
      {
          string[] array = item.FacultyList.Split(',');
          array = array.Where(x =&gt; !string.IsNullOrEmpty(x)).ToArray();
          applicants = applicants.AsEnumerable().Where(o =&gt; array.Any(b =&gt;(b)== "4")).ToList();
      }
  }
  </code></pre>