Censura palabras de un arreglo

Published by Matt in

Crea una función que reciba una cadena str y censure cualquier palabra de un arreglo dado arr. El texto eliminado debe reemplazarse por el carácter indicado char.

Ejemplos

censorString("Today is a Wednesday!", ["Today", "a"], "-") ➞ "----- is - Wednesday!"

censorString("The cow jumped over the moon.", ["cow", "over"], "*") ➞ "The *** jumped **** the moon."

censorString("Why did the chicken cross the road?", ["did", "chicken", "road"], "*") ➞ "Why *** the ******* cross the ****?"

Notas

N/A