I have a collection of values:
- [0-20] = 1
- [21-30] = 2
- [31-40] = 3 etc.
I expect input from users in the for of [44] for example. What would be the most eloquent way to determine in which item the value falls?
I can write a switch statement to match a case > < or an if...statement but neither of these in my opinion is eloquent enough.
Update
I'm looking for a neat and tidy way of finding the range in which my user's input fall, using something like LAMDBA for example:
List<int>().Find(x => x.WithinRange(range))
Or something like that.