Pronouncing A_E

Published by Joshua Señoron in

Words with a_e in them (where the underscore represents any letters) are pronounced like ay_. Given a sentence, create a function which replaces all instances of a_e with a ay_.

Examples

pronounce_the_a_e("i want to bake a cake") ➞ "i want to bayk a cayk"

pronounce_the_a_e("cinnamon flakes") ➞ "cinnamon flayks"

pronounce_the_a_e("bravely escape and inflate") ➞ "brayvly escayp and inflayt"

pronounce_the_a_e("waste and taste") ➞ "wayst and tayst"

Notes

All words will be given in lowercase and without punctuation.

Watch a quick demo on how Edabit works.