title: Method to get keys from array
body: <p>What is the equivalent C# syntax of this PHP script ?:</p>
  
  <pre><code>&lt;?php
  $arr = array("linux", "windows", "linux", "linux", "windows", "mac os", "unix", "mac os");
  $unique = array_unique($arr);
  foreach($unique as $key=&gt;$value){
      echo $key."\n";
  }
  ?&gt;
  </code></pre>
  
  <p>the result of above code is:</p>
  
  <pre><code>0
  1
  5
  6
  </code></pre>
  
  <p>so, the duplicates of the array are removed and then the keys of the array are displayed. I could only display the values of array:</p>
  
  <pre><code>string[] arr = { "linux", "windows", "linux", "linux", "windows", "mac os", "unix", "mac os" };
  string[] uniq = arr.Distinct().ToArray();
  foreach (string unik in uniq)
  {
      textBox1.AppendText(unik+"\r\n");
  }
  </code></pre>