← Back to challenges

Vowel Replacer

JavaScriptHardstringsregex

Instructions

Create a function that replaces all the vowels in a string with a specified character.

Examples

replaceVowels("the aardvark", "#") ➞ "th# ##rdv#rk"

replaceVowels("minnie mouse", "?") ➞ "m?nn?? m??s?"

replaceVowels("shakespeare", "*") ➞ "sh*k*sp**r*"

Notes

All characters will be in lower case.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Next Element in Arithmetic Sequence