Error - .include? method undefined


#1


https://www.codecademy.com/en/courses/ruby-beginner-en-JdNDe/0/4?curriculum_id=5059f8619189a5000201fbcb

Error "method .include? undefined"


print "Give me some input: "
user_input = gets.chomp.downcase!
if user_input.include? "s"
end


#2

So, if you keep 'user_input = gets.chomp' and '.downcase!' on the same line it wont work unless you enter a capital letter.
instead do it like this -

print "Give me some input: "
user_input = gets.chomp
user_input.downcase!
if user_input.include? "s"
end


#3

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