I don't know if I am doing this right


#1

puts "What is your password?"
text = gets.chomp
puts "What is your password again?"
redact = gets.chomp
words = text.split("")
print words

if words = redact
print "REDACTED "
else
print words + " "
end


#2

words is an array of strings, you don't want to compare it directly with redact which is a string, you want to compare all elements of words (which are strings) to redact.

Also, the comparison operator (==) is different from the assignment operator (=).


#3

also, the text.split is looking for "" instead of " "