@yookue/ts-lang-utils
    Preparing search index...

    Function startsWithAny

    • Returns whether the given string starts with any of the prefixes

      Parameters

      • Optionaltext: null | string

        the source string to check

      • Optionalprefixes: (undefined | null | string)[]

        the target strings to compare

      Returns boolean

      whether the given string starts with any of the prefixes

      David Hsing

      startsWithAny('foobar', ['foo', 'bar']);    // true
      startsWithAny('hello', ['foo', 'bar']); // false