How to store unique values of array in another array

Samir samir at aol.com
Thu Oct 18 19:19:53 UTC 2018


On Thursday, 18 October 2018 at 18:53:06 UTC, Adam D. Ruppe wrote:
> But, if you need to copy it into a new array, use `.array` at 
> the end.

Thanks.  That did the trick.  But if I may, what is the 
difference between

uniqueArray = uniq(sort(unsortedArray)).array;

and

uniqueArray = unsortedArray.sort().uniq.array;

They both seem to work.  Is one preferred over the other?



More information about the Digitalmars-d-learn mailing list