3. Downcase! constant error


#1

Hey there, I'm having a bit of an issue on ;
3. Downcase!

It keeps on saying that I need to call on the .downcase method for user_input, which is hopefully what I'm already doing. The code is :

print "What is my name?"
!user_input = gets.chomp
user_input.downcase

#2

Hi @ellycx ,

Please post a link to the exercise.

This leaves the value of the variable unchanged ...

user_input.downcase

Call the downcase! method, instead, to actually change the object to lowercase.

user_input.downcase!

#3

I'm pretty sure that by calling .downcase, it changes everything to downcase, but only once. Doesn't .downcase! actually change the word, so that next time it is called, it'll be lowercase? Sorry, I'm a bit rusty on my Ruby.... Hey.... That rhymes!


#4

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