Calling "Capitalize!"


#1



I'm just wondering, but when I do ...

last_name = gets.chomp
last_name2 = last_name.capitalize!

it has the same effect as
last_name = gets.chomp.capitalize!

The second way of coding is easier, and I'm not sure if it works with other things as well, but do you know if I should use the second way I found to code? Thanks!



#2

Try entering some text that is capitalized already. Now check the outputs.


#3

Ohh! You're right, it does effect the output! Thanks so much! :slight_smile:


#4

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