4/6 Redacted problem


Hi all..it is one day that I'm stuck here....I followed all the advices of the other topics about this point but I'm still with same error
....Oops, try again. It looks like you didn't print each word from the user's text to the console....
Please have a check of my code
puts"stefano bo:"
puts"dirisio bo:"
words.each do |word|
print word+"" (I tried with space and no space and also only with word)


Try taking out your +"" after print word


I already tried....but nothing...I also rewrote all.....and I tried also to write only the lines from split to end without the previous lines...((((


Maybe a little more respect for the concept with sensible phrasing will help:

puts "Please enter some text"
text = gets.chomp
puts "Enter a word to redact"
redact = gets.chomp
words = text.split(' ')    # the space is important

That is the set up. Now to write the redaction method...

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

The above is in principle. Check the instructions for exact details expected.