title: Efficient way to remove duplicate strings from a string array in C#
body: <p>I would like to know an efficient method to remove duplicate items from a string array in C#.</p>
  
  <p>For example,</p>
  
  <pre><code>string[] a = { "abc", "xyz","abc", "def", "ghi", "asdf", "ghi","xd", "abc" };
  </code></pre>
  
  <p>will become, </p>
  
  <pre><code>string[] a = { "abc", "xyz","def", "ghi", "asdf", "xd" };
  </code></pre>
  
  <p>How to fill the gaps after removing the duplicate entries? 
  Is there a way to do this without using an extra array for storing the elements? </p>
  
  <p>Method which I used:</p>
  
  <pre><code>1) Sorted the array
  
  2) Replaced the duplicate entries with null
  
  3) Copied NOT null string to a new array.
  </code></pre>
  
  <p>But looking for an optimized way to doing the same.</p>
  
  <p>EDIT: I am using .NET 2.0 and VS 2005</p>