upcase does not change the original string : upcase « String « Ruby






upcase does not change the original string


un_banged = 'Hello world.'
un_banged.upcase    # => "HELLO WORLD."
un_banged       # => "Hello world."

banged = 'Hello world.'
banged.upcase!      # => "HELLO WORLD."
banged          # => "HELLO WORLD."

 








Related examples in the same category

1.Call upcase function from string class on a sentence
2.Call upcase function from string on a word
3.upcase or upcase!
4.Change string to upper case in place