Code doesn't work


#1

Is there a bug on this section? Code doesn't work :confused:

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

words = text.split(" ")

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


Redacted 1. what we will be building
#2

No bugs. I would suggest re-read the entire unit and get aquainted with what is expected. The code is perfect; almost too perfect given the usage on the right.

how do you do?

is hardly a word, and it is not in the text to search through.