Skip to content

Capitalize every word in string: unicorn cake → Unicorn Cake

License

Notifications You must be signed in to change notification settings

sindresorhus/titleize

Repository files navigation

titleize Build Status

Capitalize every word in a string: unicorn cakeUnicorn Cake

Install

$ npm install titleize

Usage

const titleize = require('titleize');

titleize('foo bar');
//=> 'Foo Bar'

titleize('foo-bar');
//=> 'Foo-Bar'

Related

  • camelcase - Convert a dash/dot/underscore/space separated string to camelcase

License

MIT © Sindre Sorhus