This code replaces every vowel of the string with "X":
def vowel_censor(sentence)
vowels = "aeiou".chars
result = []
sentence.chars.each do |charachter|
if vowels.include?(charachter)
result << "X"
else
result << charachter
end
end
result.join("")
end
puts "---------Vowel Censor----------"
puts vowel_censor("Let's order a pizza") == "LXt's XrdXr X pXzzX"
puts vowel_censor("Nitwit, blubber, oddment, tweak") == "NXtwXt, blXbbXr, XddmXnt, twXXk"
puts vowel_censor("Supercalifragilisticexpialidocious") == "SXpXrcXlXfrXgXlXstXcXxpXXlXdXcXXXs"