My code will print both the word to be redacted and then the text "REDACTED " right next to each other. I'm not sure what I'm doing wrong here. Any input? Thanks
'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!).'
puts "Please enter the text you would like to redact from: " text = gets.chomp puts "Please enter the word you would like to redact" redact = gets.chomp words = text.split(" ") words.each do |word| print word if word = redact print "REDACTED " else print word + " " end end