Skip to content

Instantly share code, notes, and snippets.

@MikeSilvis
MikeSilvis / gist:3090737
Created July 11, 2012 14:31 — forked from chrismanderson/gist:3090735
Titleize.coffee
String::titleize = ->
titleized = this.split(" ")
UNCAPITALIZED = ['a', 'an']
titleized = (
for word, index in titleized
if word and word.toUpperCase
if word in UNCAPITALIZED && index != 0
word
else