I have an List which contains 1,2,4,7,9 for example.
List
I have a range from 0 to 10.
Is there a way to determine what numbers are missin
Turn the range you want to check into a HashSet:
public IEnumerable FindMissing(IEnumerable values) { HashSet myRange = new HashSet(Enumerable.Range(0,10)); myRange.ExceptWith(values); return myRange; }
Will return the values that aren't in values.
values