Function prependIfMissingIgnoreCase

  • Returns a string that concat the given prefix and text, case-insensitive

    Parameters

    • Optionaltext: null | string

      the text to check

    • Optionalprefix: string

      the prefix to prepend

    Returns string | undefined | null

    a string that concat the given prefix and text, case-insensitive

    prependIfMissingIgnoreCase('bar', 'foo');    // 'foobar'
    prependIfMissingIgnoreCase('foobar', 'FOO'); // 'foobar'