How to copy all different elements from an array in c# -


We say that there is an array like this:

  double [] number = new Double [] {1,1,2,2,5,7,7,7};  

I want to copy only a different number in a different array (result number = {1,2,5,7}) in a timely manner efficiently. I know how to do it in a disabling manner at a time - given that the next number is the same and if the copy keeps loop. Is there any other way?

If you do not have a link, you can do the following:

  list & lt; Double & gt; Unix = new list & lt; Double> Forex currency (double number in number) {if (! Uniques.Contains (num)) uniques.Add (num); } Double [] uniquearray = uniques.ToArray ();  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -