.net - Straightforward way to verify uniqueness of an IEnumerable elements -


What is the simplest way of being a IEnumerable value of integer Is it possible to verify that all elements are unique?

Compare the number of unique elements with total count:

  Sequence.Disting (). Calculation () == sequence.count ();  

Note that this will tell your sequence 2-3 times.


Comments

Popular posts from this blog

scala - Play Framework - how to bind form to a session field -

Django Celery - running scheduled tasks -

perl - 'Unquoted string ".." may clash with future reserved word' but only when package is used -