title: Remove duplicates from comma separated list
body: <p>I wrote the following program in C# to remove duplicate elements in a string. However this program is not able to remove duplicate elements in a comma separated string. Can someone please help me as to how can I remove duplicates like 48375 in the below code from a comma separated list.</p>
  
  <pre><code>using System.IO;
  using System;
  using System.Linq;
  
  class Program
  {
      static void Main()
      {
          string inf = "48375 , 36143 , 66516 , 332674 , 107028 , 319546 , 362998 , 324285 , 110470 , 47870 , 17507 , 331420 , 59873 , 19531 , 107100 , 102487 , 97561 , 332674 , 322436 , 348305 , 44900 , 89921 , 41063 , 105962 , 319546 , 80476 , 363510 , 65760 , 344153 , 52328 , 51692 , 101922 , 359192 , 341859 , 37437 , 356670 , 37550 , 91952 , 349196 , 69361 , 52663 , 110705 , 48701 , 99730 , 343144 , 22001 , 66516 , 85782 , 362998 , 324285 , 16487 , 332329 , 352225 , 329868 , 36143 , 48375 , 97871";
  
          Console.Out.WriteLine(string.Join(" , ", inf.Split(',').Distinct().ToList().ToArray()));
      }
  }
  </code></pre>