+ 1

What do make this code?

puts "Enter some text: " text = gets.chomp puts "Enter words to redact: " redact = gets.chomp words = text.split(" ") words.each { |word| if word == redact print "REDACTED " else print word + " " end }

10th Sep 2022, 5:51 PM
Leydy Mayumy
Leydy Mayumy  - avatar
1 Answer
+ 1
Run it in Code Playground and you will see
11th Sep 2022, 1:36 AM
Emerson Prado
Emerson Prado - avatar