What's wrong with user_input.downcase!.include? "s"


What's wrong with this method concatenation?:

print "Type your string: "
user_input = gets.chomp
if user_input.downcase!.include? "s"
    puts "it includes an s"


Hi, @courserockstar35052 ,

Consider what this statement does ...

if user_input.downcase!.include? "s"

What does the downcase! method return if the string on which it is called is already in all lowercase?


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