We want to make sure we capture both
"s" in the user’s input. We could write separate
else statements to handle this, but we can also use
.downcase! to convert the user’s input to all lower case. That way, we only have to search for
.downcase! method on
user_input. Make sure to include the
! so that the user’s string is modified in-place; otherwise, Ruby will create a copy of
user_input and modify that instead.
After running the code, make sure to enter a string in the terminal.
Take this course for free