README
string-case
capitalize - It returns the first letter to uppercase
'heLlo world' => HeLlo world
capitalizeAndLowerCaseAllTheOthers - It returns the first letter to uppercase and all other words in the string will be converted to lowercase.
'heLlo world' => Hello world
initCap - It returns a character string with the first letter of each word converted to uppercase.
'heLlo World' => HeLlo World
initCapAndLowerCaseAllTheOthers - It returns a character string with the first letter of each word converted to uppercase. All other letters in the string will be converted to lowercase.
'heLlo World' => Hello World
'heLlo-World' => Hello-World
Installation
npm install string-case --save
Usage
var $ = require('string-case')
var result = $.capitalize ('hello world'); // Hello world
var result = $.capitalizeAndLowerCaseAllTheOthers ('hello WoRld'); // Hello World
var result = $.initCap ('hello world'); // Hello World
var result = $.initCap ('hello-world'); // Hello-World
var result = $.initCapAndLowerCaseAllTheOthers ('helLo woRld'); // Hello World
var result = $.initCapAndLowerCaseAllTheOthers ('hello-world'); // Hello-World