Question about capitalize and upcase


#1

So why can I use the following code?

print "What's your first name?"
first_name = gets.chomp.capitalize
print "What's your last name?"
last_name = gets.chomp.capitalize
print "What's your city?"
city = gets.chomp.capitalize
print "What's your state?"
state = gets.chomp.upcase

print "#{first_name} #{last_name} is from #{city}, #{state}"


#2

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