Capitalizing 2 words


#1



https://www.codecademy.com/courses/ruby-beginner-en-MxXx5/0/7?curriculum_id=5059f8619189a5000201fbcb


If I enter a city name that is two words long, ex. san francisco, How do I make the code capitalize both words?


print "What city do you live in?"
city = gets.chomp
city2 = city.capitalize
city.capitalize!


#2

@microblaster92411
google search
== discussions / opinions ==
ruby capitalize multiple words site:stackoverflow.com
http://stackoverflow.com/questions/13520162/ruby-capitalize-every-word-first-letter


#3

Can someone post a solution with an explanation of the methods?

leonhard, I see several solutions, but they are using methods we are not familiar with. I think what both microblaster and I need are explanations how how these are done.