Convert a string between camelCase, PascalCase, Title Case, snake_case and more.
npm install @rgbdev/change-case[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]

Convert strings between camelCase, PascalCase, Title Case, snake_case, lowercase, UPPERCASE, CONSTANT_CASE and more.
All methods support Unicode (non-ASCII characters) and non-string entities, such as objects with a toString property, numbers and booleans. Empty values (null and undefined) will result in an empty string.
Methods are also available on npm as an individual packages.
```
npm install change-case --save
`js`
var changeCase = require('change-case')
//=> { isUpperCase: [Function], camelCase: [Function], ... }
Available methods (short-hand shown below, long-hand available in examples):
* camel
* constant
* dot
* header
* isLower
* isUpper
* lower
* lcFirst
* no
* param
* pascal
* path
* sentence
* snake
* swap
* title
* upper
* ucFirst
All methods accept two arguments, the string to change case and an optional locale.




Return as a string with the separators denoted by having the next letter capitalized.
`js`
changeCase.camelCase('test string')
//=> "testString"




Return as an upper case, underscore separated string.
`js`
changeCase.constantCase('test string')
//=> "TEST_STRING"




Return as a lower case, period separated string.
`js`
changeCase.dotCase('test string')
//=> "test.string"




Return as a title cased, dash separated string.
`js`
changeCase.headerCase('test string')
//=> "Test-String"




Return a boolean indicating whether the string is lower cased.
`js`
changeCase.isLowerCase('test string')
//=> true




Return a boolean indicating whether the string is upper cased.
`js`
changeCase.isUpperCase('test string')
//=> false




Return the string in lower case.
`js`
changeCase.lowerCase('TEST STRING')
//=> "test string"




Return the string with the first character lower cased.
`js`
changeCase.lowerCaseFirst('TEST')
//=> "tEST"




Return the string without any casing (lower case, space separated).
`js`
changeCase.noCase('test string')
//=> "test string"




Return as a lower case, dash separated string.
`js`
changeCase.paramCase('test string')
//=> "test-string"




Return as a string denoted in the same fashion as camelCase, but with the first letter also capitalized.
`js`
changeCase.pascalCase('test string')
//=> "TestString"




Return as a lower case, slash separated string.
`js`
changeCase.pathCase('test string')
//=> "test/string"




Return as a lower case, space separated string with the first letter upper case.
`js`
changeCase.sentenceCase('testString')
//=> "Test string"




Return as a lower case, underscore separated string.
`js`
changeCase.snakeCase('test string')
//=> "test_string"




Return as a string with every character case reversed.
`js`
changeCase.swapCase('Test String')
//=> "tEST sTRING"




Return as a space separated string with the first character of every word upper cased.
`js`
changeCase.titleCase('a simple test')
//=> "A Simple Test"




Return the string in upper case.
`js`
changeCase.upperCase('test string')
//=> "TEST STRING"




Return the string with the first character upper cased.
`js``
changeCase.upperCaseFirst('test')
//=> "Test"
Includes a TypeScript definition.
MIT
[npm-image]: https://img.shields.io/npm/v/change-case.svg?style=flat
[npm-url]: https://npmjs.org/package/change-case
[downloads-image]: https://img.shields.io/npm/dm/change-case.svg?style=flat
[downloads-url]: https://npmjs.org/package/change-case
[travis-image]: https://img.shields.io/travis/blakeembrey/change-case.svg?style=flat
[travis-url]: https://travis-ci.org/blakeembrey/change-case
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/change-case.svg?style=flat
[coveralls-url]: https://coveralls.io/r/blakeembrey/change-case?branch=master