Control flow know how? please check the code


puts "Text to search through: "
text = gets.chomp
puts "Word to redact: "
redact = gets.chomp

words = text.split(" ")

words.each do |word|
  if word === redacted
    print "REDACTED "
    print word + " "


I am not an expert but i believe that your problem may be the extra = in your if block


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.