startsWithAny method

bool startsWithAny(
  1. Iterable<String> prefixes
)

Checks if the string starts with any of the provided prefixes.

Example:

'hello'.startsWithAny(['he', 'hi']); // true

Implementation

bool startsWithAny(Iterable<String> prefixes) {
  return prefixes.any((prefix) => startsWith(prefix));
}