When executed, the code below does indeed replace the redacted words with "REDACTED " It prints the other words as the user entered them (with the appropriate " " after each one).
However, the tutorial responds with "Oops, try again. Make sure to print each word from the user's text to the console unless that word is the word to be redacted; if it is,print REDACTED (all caps!)."
As far as I can tell, I've satisfied the code specs, but the tutorial will not let me advance. Thank you any and all for your help.
puts "Enter a string please." text = gets.chomp puts "Enter word to be redacted." redact = gets.chomp word = text.split(" ") #word is an array word.each do |i| if i == redact print "REDACTED " else print i + " " end end