@unikue/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