Created
October 21, 2014 13:32
-
-
Save matstc/14943ebdd7d2afabb107 to your computer and use it in GitHub Desktop.
Example with temporary variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def title_case string | |
words = string.split " " | |
capitalized_words = words.map {|w| w.capitalize} | |
title = capitalized_words.join " " | |
return title | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment