Last active
December 16, 2015 06:39
-
-
Save cesarfigueroa/5393196 to your computer and use it in GitHub Desktop.
Basic titleize function. Useful for copy-pasting from poorly formatted documents.
This file contains 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
class String | |
def titleize | |
self.downcase.split.map(&:capitalize).join(' ') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment