Function startsWithIgnoreCase

  • Returns whether the given string starts with the prefix, case-insensitive

    Parameters

    • Optionaltext: null | string

      the source string to check

    • Optionalprefix: null | string

      the target string to compare

    Returns boolean

    whether the given string starts with the prefix, case-insensitive

    startsWithIgnoreCase('foobar', 'FOO');    // true
    startsWithIgnoreCase('hello', 'BAR'); // false