endsWithIgnoreCase static method

bool endsWithIgnoreCase(
  1. String? str,
  2. String? suffix
)

Test if string ends with suffix, ignoring case

Implementation

static bool endsWithIgnoreCase(String? str, String? suffix) {
  if (str == null || suffix == null) return false;
  if (str.length < suffix.length) return false;
  return str.toLowerCase().endsWith(suffix.toLowerCase());
}