I've got an IEnumerable<T>
containing a list of data elements with consistent intervals in one of the properties:
List<Interval> list = new List<Interval>
{
new Interval{ TIME_KEY = 600},
new Interval{ TIME_KEY = 605},
new Interval{ TIME_KEY = 615},
new Interval{ TIME_KEY = 620},
new Interval{ TIME_KEY = 630}
};
How can I query this list (using Linq, preferably), to get a List that looks like this:
List<Interval> list = new List<Interval>
{
new Interval{ TIME_KEY = 610},
new Interval{ TIME_KEY = 625}
};
?
EDIT: I will probably know what the interval distance is supposed to be, but if there's a way to determine it by examing the data, that would be a huge bonus!
EDIT: changed to numeric values