Check if date range is sequential in c#?
Assume I have a user interface where the user can select days. Is there a way to check if the days selected are sequential, such as: 4/4, 4/5, 4/6, 4/7, 4/8, 4/9, 4/10 or 4/29, 4/30, 5/1, 5/2, 5/3 I know I probably can loop through the date range and check, but I was more curious if there was a built in method already to check for this. Regarding the above scenarios, they are in order and they can roll over into the next month. I am using the .NET Framework 2.0 and can't use LINQ. Regarding Tom's answer: DateTime dtStart = new DateTime(2011,5,4); DateTime dtEnd = new DateTime(2011,5,11); int