startsWithIgnoreCase static method

bool startsWithIgnoreCase(
  1. String? str,
  2. String? prefix
)

Test if string starts with prefix, ignoring case

Implementation

static bool startsWithIgnoreCase(String? str, String? prefix) {
  if (str == null || prefix == null) return false;
  if (str.length < prefix.length) return false;
  return str.toLowerCase().startsWith(prefix.toLowerCase());
}