If statement to reprompt input?


#1

Alright so I'm guessing there's a looping method I can use here if the user doesn't type anything.
I just can't think of what exactly that'd be. If you have any suggestions, I'd love to hear them. this is the code for what i'm working on. Help please : P

print "thtring pleathe!"
user_input = gets.chomp
user_input.downcase!

I'm guessing the "if" statement would fit here?

if user_input.include? "s"
user_input.gsub!(/s/, "th")
end

if user_input.include? "ce"
user_input.gsub!(/ce/, "the")
end

if user_input.include? "ci"
user_input.gsub!(/ci/, "thi")
end

if user_input.include? "cy"
user_input.gsub!(/cy/, "thi")
end

puts user_input


#2

I'm not sure exactly what you're looking for, because you first talk about a loop and then an if statement. Can you reexplain what you want to implement in your code?


#3

TRY THIS:

print "user's input" .downcase!
user_input = gets.chomp
if user_input.include? "s"
end