I don't know if I am doing this right


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 "
print words + " "


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 (=).


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