Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, November 19, 2012

Codecademy: "Control Flow Know-How"


#sample solution


text = gets.chomp
puts "Enter the word to redact / censor in your text: "
redact = gets.chomp

words = text.split(" ")

words.each {|word|
  if word != redact
    print "#{word}"+" "
  else
    print "REDACTED "
  end
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts