4/6 Redacted problem


#1

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:"
text=gets.chomp
puts"dirisio bo:"
redact=gets.chomp
words=text.split("")
words.each do |word|
print word+"" (I tried with space and no space and also only with word)
end


#2

Try taking out your +"" after print word


#3

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...((((


#4

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 "
    else
        print word + " "
    end
end

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