Created
July 25, 2018 18:42
-
-
Save zxaos/1722dfa8a4a9322fe8e87c214f80504e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "Enter some text: " | |
text = gets.chomp | |
puts "Enter redact: " | |
redact = gets.chomp | |
words = text.split(" ") | |
words.each do |word| | |
if word == redact | |
print "REDACTED" | |
else | |
print word | |
end | |
print " " | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment