• Replace string by array pattern

    Example

    replaceArr('str', ['s','r'], ''); // t
    replaceArr('str', ['s','r'], ['a s', 'ring']); // a string

    Parameters

    • str: string
    • array: (string | RegExp)[]
    • replacement: string | string[]

    Returns string