/title-case

Convert string to title case, mostly following the Yahoo! Style Guide

Primary LanguageCoffeeScript

Rules and examples are borrowed from the Yahoo! Style Guide

 titleCase("don't fence me in");
 "Don't Fence Me In"
 titleCase("walk with me in moonlight");
 "Walk With Me in Moonlight"
 titleCase("what if I do, WHAT IF SHE WON'T");
 "What If I Do, What If She Won't"
 titleCase("the least she could do is cry");
 "The Least She Could Do Is Cry"
 titleCase("sales of iPod soar");
 "Sales of iPod Soar"
 titleCase("sales soar of iPods");
 "Sales Soar of iPods"
 titleCase("iPod sales soar");
 "IPod Sales Soar"
 titleCase("The big spender's budget how-to");
 "The Big Spender's Budget How-To"
 titleCase("author of how-to book on bee-keeping prone to illness");
 "Author of How-to Book on Bee-Keeping Prone to Illness"
 titleCase("GOVERNOR SLAMS E-BOOK ABOUT HER RE-ELECTION CAMPAIGN");
 "Governor Slams E-Book About Her Re-Election Campaign"
 titleCase("profits double on word-of-mouth sales");
 "Profits Double on Word-of-Mouth Sales"
 titleCase("audiences love his man-about-town sophistication");
 "Audiences Love His Man-About-Town Sophistication"
 titleCase("open your own eBay-based Boutique");
 "Open Your Own eBay-Based Boutique"