samedi 20 décembre 2014

Ruby - Adding more than one includes on an if statement

I have the following code which works fine



if user_input.include? "s"
user_input.gsub!(/s/ "th")
else
print "Nothing to change"
end


But when I want to add another include like so it does not recognize the elsif How do I add these includes together?



if user_input.include? "s"
user_input.gsub!(/s/ "th")
if user_input.include? "cee"
user_input.gsub!(/cee/ "th")
else
print "Nothing to change"
end

Aucun commentaire:

Enregistrer un commentaire