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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -