I’m trying to get through the ruby track but I have run into an exercise that is giving me headaches
This is my problem: my code is supposed to redact whatever input I choose for redact on the fourth line.
Except it doesn’t.
What am I missing?
Thank you in advance for your help.
Oh and while I’m at it, I’m not sure why i need two ‘end’ either.
Here is my code so you can copy past it, and a screenshot to be more legible:
puts "What text do you want redacted? "
puts "What word should be redacted? "
redact = gets.chomp
words = text.split(" ")
words.each do |redaction|
if words == redact
print "REDACTED "
else print redaction + " "