I have uploaded my code and testing. Please explain why it is not working ?
It does not even redacted first occurrence of the word.
Below is the code
puts 'Please enter the text:' text = gets.chomp puts 'Please enter the redact:' redact = gets.chomp redact = redact.downcase! words = text.split(" ") words.each do |word| if word == redact print "REDACTED " else print word + " " end end