.include? issues


I actually got all the way to section 13 before I got the .include? error message, in other words, the program had no issues with it before and now that I've gone back and retyped it repeatedly (and even after watching a youtube tutorial) I still don't know what I'm doing wrong... Although I'm sure its likely painfully obvious.


Error message: undefined method `include?' for nil:NilClass

print "test drive. vroom, vroom."
user_input = gets.chomp.downcase!
if user_input.include? "s"
    print "SSSS in the house"


Try using


without the so-called Bang-sign

google search
== discussions / opinions ==
ruby downcase with bang site:stackoverflow.com


it worked! Thank you!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.