Setting Up the 'If' Branch, Part 1


The code I have works, but the "test" is saying that it's wrong, unless I put a caps in somewhere.

Seriously? I figured Ruby would be smart enough to recognize if it's caps or not.

print "Enter in a statement."
user_input = gets.chomp.downcase!
if user_input.include? "s"
print user_input


Seriously. Ruby returns the altered string IF any change takes place, else it returns nil. Of course, nil has no attributes so no include method. Use downcase so the inputs don't matter.


When it asks to use downcase to pass by, it seems sort of counter intuitive...


Until we read up on it and discover the difference between downcase and downcase!.


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