Stage 5


puts "Text to search through"
text = gets.chomp
puts "Words to redact"
redact = gets.chomp

words = text.split(" ")

words.each do |word|
if word == redact
print "REDACTED!"
else print word + " "

whats wrong with my code


The lesson is really, really, really picky about what is printed to the console. What you need is

print "REDACTED "

with a space afterwards, and no exclamation point.