How can I exclude the dates on this list?

In the previous question below

Is there any way to avoid counting certain days of the week? - Help / Activities - UiPath Community Forum

TargetDate.AddDays(Enumerable.Range(1,7).Where(Function(i) workingDay.Contains(targetDate.AddDays(i).DayOfWeek)).Skip(2).Take(1). First)

I learned how to write the following.
I’m using the above method as a reference, but now I have to write a specification to remove dates in “holidays” variable (List(datetime) type) in the above filtering condition.

I’m trying to find a way how to remove the dates of the List type variable from the above formula, but I haven’t found the right way yet.

If you know how to remove the date in the list above, please let me know how to write it in “Where”.

Thank you for reading

Hi,

Maybe try this:

targetDate.AddDays(Enumerable.Range(1,7).Where(Function(i) not holidayListVariable.Contains(targetDate.AddDays(i))).Skip(2).Take(1).First).ToShortDateString

Hope this helps,

1 Like

I don’t know “not”
Thanks to tell me it

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.