puts "Write message body:"
text = gets.chomp
puts "Write words to redact separated by space:"
redact = gets.chomp
redact.downcase!
redact_words = redact.split(" ")
redact_words.each do |r|
text_words = text.split(" ")
text_words.each do |b|
if b.downcase == r
print "REDACTED "
else
print b + " "
end
end
end
=begin
Write message body:
test one two three
Write words to redact separated by space:
test three
REDACTED one two three test one two REDACTED ["test", "three"]
but I want to get this result: "REDACTED two REDACTED ["test", "three"]"
=end