Censure palavras de um array

Published by Matt in

Crie uma função que receba uma string str e censure qualquer palavra de um array fornecido arr. O texto removido deve ser substituído pelo caractere informado char.

Exemplos

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 ****?"

Observações

N/A