ruby - Stop a while loop when a specific term/word is detected in the string -
i know how create code in ruby stop while loop not matter written long gets string contains word "yes".
this have far:
while start!="yes" #make stops loop if ex:"yes, please!!!" inputed. #does stuff start=gets.chomp end thank much.
i think work, btw until same while negative condition.
input = gets.chomp.downcase until input.include? 'yes' # stuff input = gets.chomp.downcase end
Comments
Post a Comment