Trouble with "Redacted!" Lesson 5


#1

Hi everyone, this is my code below. I can't quite figure out what's wrong with it. Any suggestions?

puts "What did you say this time?"
text_1 = gets.chomp
puts "Okay, so how can I help you fix this mess?"
text_2 = gets.chomp

words=text_1.split(" ")
words.each do |word|
if word == text_2
print "REDACTED "
else
print word + " "
end


#2

Missing an end for the .each do.


#3

That solved it! Thank you!


#4

A post was split to a new topic: Why my code is not working?