Skip to content

to title case

Subhajit Sahu edited this page May 5, 2020 · 1 revision

Convert string to title case.

const toTitleCase = require('@extra-string/to-title-case');
// toTitleCase(<string>, [separator=/\W+/g])

toTitleCase('Geminid meteor shower')
// 'Geminid Meteor Shower'
toTitleCase('geminid-meteor-shower');
// 'Geminid Meteor Shower'
toTitleCase('geminid_meteor_shower', '_');
// 'Geminid Meteor Shower'

extra-string

Clone this wiki locally