Question: I have this code:

```
intents = ['hello world', 'random string']

phrase = input(Enter your message: )

if phrase in intents:
    print('Found')

```

How can I check if phrase in intents without typing the exact strings in intents, If it's only one word it's easy but multiple words it's not working like that:

```
Enter your message: hello world this python
>>> Found

```

Answer: 
Just add one to the date, and see if it's in the next month:

```
void main(List<String> arguments) {
  for (final w
      in '2022-01-01 2022-01-30 2022-01-31' ' 2022-02-01 2022-02-28 2024-02-28'
          .split(' ')) {
    // print(w);
    final wd = DateTime.parse(w);
    final isLastDay = isLastDayOfMonth(wd);
    print('$w is last day of month? $isLastDay');
  }
}

bool isLastDayOfMonth(DateTime when) {
  return DateTime(when.year, when.month, when.day + 1).day == 1;
}

### output:

2022-01-01 is last day of month? false
2022-01-30 is last day of month? false
2022-01-31 is last day of month? true
2022-02-01 is last day of month? false
2022-02-28 is last day of month? true
2024-02-28 is last day of month? false

```
I would filter for the month, sort the list and take the first entry:

```
void main() {
  List<DateTime> list = [DateTime(2000,06,23), DateTime(2000,06,21),DateTime(2000,06,22)];
  list = list.where((date) => (date.month == 6)).toList();
  list.sort((a,b) => b.day.compareTo(a.day));
  print(list[0]);
}

```