Skip to content

Instantly share code, notes, and snippets.

@zxaos
Created July 25, 2018 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zxaos/1722dfa8a4a9322fe8e87c214f80504e to your computer and use it in GitHub Desktop.
Save zxaos/1722dfa8a4a9322fe8e87c214f80504e to your computer and use it in GitHub Desktop.
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