Redacted ! # 5


#1

puts "Explain"
text=gets.chomp
puts "Redact it"
redact=gets.chomp
word= text.split("")
word.each do |word|
print word
if word == redact
print "REDACTED"
else
print word + ""
end
end

There is no explanation for the two END codes. I have also tried many rearrangements of code. I must be missing something.


#2

The first end is for your if/else statement. The second is for your each method.


#3

Ahhhh thank you for that. I passed that lesson shortly after btw.