startsWithAny static method

bool startsWithAny(
  1. String text,
  2. List<String> prefixes
)

Check if string starts with any of the given prefixes

text - The text to check prefixes - List of prefixes to check Returns true if text starts with any prefix

Implementation

static bool startsWithAny(String text, List<String> prefixes) {
  return prefixes.any((prefix) => text.startsWith(prefix));
}