Skip to Content
Learn
Introduction to Ruby
'.upcase' & '.downcase'

Let’s try one more method (er, two methods). As you might have guessed, the .upcase and .downcase methods convert a string to ALL UPPER CASE or all lower case, respectively.

Instructions

1.

Call .upcase on your name to make your name ALL CAPS and use puts to print it to the screen, like this:

puts "eric".upcase # ==> ERIC

On the next line, call .downcase to make your name all lower case. Make sure to use puts so you can see it printed out!

Folder Icon

Take this course for free

Already have an account?