Skip to content

Instantly share code, notes, and snippets.

@awesome
Created January 18, 2017 20:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save awesome/621e74a3657cdc9944587b9b766a6000 to your computer and use it in GitHub Desktop.
def titleize(str)
str.split.map {|s| (x = s.strip.downcase)[0].upcase + x[1..-1]}.join(' ')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment