title: Avoid Adding duplicate elements to a List C#
body: <pre><code>string[] lines3 = new string[100];
  List&lt;string&gt; lines2 = new List&lt;string&gt;();
  lines3 = Regex.Split(s1, @"\s*,\s*");
  
  if (!lines2.Contains(lines3.ToString()))
  {
      lines2.AddRange(lines3.Distinct().ToArray());
  }
  </code></pre>
  
  <p>I have checked all the spaces etc but i still get duplicate values in my lines2 <code>List</code></p>
  
  <p>I have to remove my duplicate values here itself </p>