title: Remove duplicates from a List<string> in C#
body: <p>Remove duplicates from a List in C#</p>
  
  <p>I have a data reader to read the string from database.</p>
  
  <p>I use the List for aggregate the string read from database, but I have duplicates in this string.</p>
  
  <p>Anyone have a quick method for remove duplicates from  a generic List in C#?</p>
  
  <pre><code>List&lt;string&gt; colorList = new List&lt;string&gt;();
  
      public class Lists
      {
          static void Main()
          {
              List&lt;string&gt; colorList = new List&lt;string&gt;();
          }
      }
  
      protected void Page_Load(object sender, EventArgs e)
      {
          if (!Page.IsPostBack)
          {
              colorList.Add(variableFromDB.ToString());
  
                      foreach (string color in colorList)
                      {
                        Response.Write(color.ToString().Trim());
                      }
          }
      }
  </code></pre>