I have a C# method like this:
public static int DaysLeft(DateTime startDate, DateTime endDate, Boolean excludeWeekends, String excludeDates)
{
}
What it's supposed to do is calculate the number of days between the startDate and endDate, but optionally needs to exclude weekends and also other dates (passed in as a comma-separated string of dates).
I have absolutely no idea how to tackle this. My gut instinct would be to loop from startDate to endDate and do some string comparisons, but from what I can find out, C# doesn't allow looping through dates in that way - or at least it's not a very elegant way of doing things.