How can I get Monday and Friday from a date range (start and end date)?Example:startdate - 03/24/2014 enddate - 04/01/2014Result should be:Monday - 2 Friday - 2I tried this code: Monday = CountDays(DayOfWeek.Monday, startDate, endDate);Friday = CountDays(DayOfWeek.Friday, startDate, endDate);static int CountDays(DayOfWeek day, DateTime start, DateTime end){    TimeSpan ts = end - start;                         int count = (int)Math.Floor(ts.TotalDays / 7);     int remainder = (int)(ts.TotalDays % 7);           int sinceLastDay = (int)(end.DayOfWeek - day);       if (sinceLastDay < 0) sinceLastDay += 7;             if (remainder >= sinceLastDay) count++;    return count > 0 ? count : 0;}And this code works!  Is there any other way to simplify this code?
Counting Monday and Friday from a Date Range
c#;datetime