Redacted 4/6


#1

I’m trying to figure out what im doing wrong in this question.
My code goes like this:

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

puts "Enter text: "
redact = gets.chomp

words = text.split(’ ')
words.each do |placeholder|
print words
end

I know that im supposed to print each word that the user types in the text input, but for example if you type “Hello world” in the user input then it comes out as:
"[“Hello”, “world”][“Hello”, “world”]".
I have no idea what im doing wrong.


#2

Rather than printing the whole array once for each word in the array, print each word


#3

Ah it works now Thank you


#4

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