Function endsWithIgnoreCase

  • Returns whether the given string ends with the suffix, case-insensitive

    Parameters

    • Optionaltext: null | string

      the source string to check

    • Optionalsuffix: null | string

      the target string to compare

    Returns boolean

    whether the given string ends with the suffix, case-insensitive

    endsWithIgnoreCase('foobar', 'BAR');    // true
    endsWithIgnoreCase('hello', 'BAR'); // false