Control flow understanding


#1

HI

Can someone explain at the second last line of my code what does print x + " " means ? Especially what does + " " means
?

puts "input text"
text = gets.chomp
puts "words to redact"
redact = gets.chomp

words = text.split(" ")
words.each do |x|
    if x == redact
        print "REDACTED "
    else
        print x + " "
    end
        

.


#2

That means display the current value of x and add a space after it.


#3

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