insensitiveContains method
Checks whether any element of this iterable loosely matches element
.
"Loosely" being case-insensitive and discarding whitespace.
Checks every element in iteration order, and returns true if any of them loosely match element
, otherwise returns false.
Implementation
bool insensitiveContains(String element) => any((s) => s.toLowerCase().replaceAll(whitespacePattern, '') == element.toLowerCase().replaceAll(whitespacePattern, ''));