Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts "Say something "
- text = gets.chomp
- text.downcase!
- puts "Words you want to redact ?"
- redact = gets.chomp
- redact.downcase!
- words = text.split(" ")
- words.each do |w|
- if w == redact
- print "REDACTED "
- else
- print w.capitalize + " "
- end
- end
Add Comment
Please, Sign In to add comment