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


#1



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"
end


#2

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?


#3

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