startsWithAny method

bool startsWithAny(
  1. String? str,
  2. List<Pattern> prefixes, [
  3. int index = 0
])

判断一个字符串以任何给定的前缀开始

Implementation

bool startsWithAny(
  String? str,
  List<Pattern> prefixes, [
  int index = 0,
]) {
  if (str == null) return false;
  return prefixes.any((prefix) => str.startsWith(prefix, index));
}