Extensible string utility for converting, identifying and flipping string case
npm install caseDownload: [Case.min.js][min] or [Case.js][full]
[NPM][npm]: npm install case (little 'c' due to NPM restrictions)
[NuGet][]: Install-Package Case

![NPM version][npm]
![NPM][npm]
[NuGet]: http://nuget.org/packages/Case/
[min]: https://raw.github.com/nbubna/Case/master/dist/Case.min.js
[full]: https://raw.github.com/nbubna/Case/master/dist/Case.js
[npm]: https://npmjs.org/package/case
javascript
Case.upper('foo_bar') -> 'FOO BAR'
Case.lower('fooBar') -> 'foo bar'
Case.capital('foo_v_bar') -> 'Foo V Bar'
`$3
`javascript
Case.snake('Foo bar!') -> 'foo_bar'
Case.pascal('foo.bar') -> 'FooBar'
Case.camel('foo, bar') -> 'fooBar'
Case.kebab('Foo? Bar.') -> 'foo-bar'
Case.header('fooBar=') -> 'Foo-Bar'
Case.constant('Foo-Bar') -> 'FOO_BAR'
`
$3
`javascript
Case.title('foo v. bar') -> 'Foo v. Bar'
Case.sentence('"foo!" said bar', ['Bar']) -> '"Foo!" said Bar'
Case.sentence('the 12 oz. can', null, ['oz']) -> 'The 12 oz. can'
`
Case.sentence(str, names, abbreviations) accepts an array of proper names that should be capitalized,
regardless of location in the sentence. This function is specialized, but useful
when dealing with input generated with capslock on (i.e. everything my grandma types).
It can also accept a list of abbreviations (words that may end in a period but aren't meant
to end a sentence).
$3
`javascript
Case.lower('FOO-BAR', '.') -> 'foo.bar'
Case.upper('Foo? Bar.', '__') -> 'FOO__BAR'
Case.capital('fooBar', ' + ') -> 'Foo + Bar'Case.lower("Don't keep 'em!", "/", true) -> 'dont/keep/em'
Case.capital("'ello, world.", null, true) -> 'Ello, World.'
`
Case.upper, Case.lower, and Case.capital accept an optional "fill" value
that will replace any characters which are not letters and numbers. All three also accept
a third optional boolean argument indicating if apostrophes are to be stripped out or left in.
For example, programmatic case changes (snake, kebab, pascal, camel, constant) are best without
apostrophes, but user-facing ones (title, sentence) do not want "don't" turned into "Dont".
$3
`javascript
Case.type('bang', function(s) {
return Case.upper(s, '!')+'!';
});
Case.bang('bang') -> 'BANG!'
Case.of('TEST!THIS!') -> 'bang'
`
Case.type(name, fn): extends Case, creating a new function on Case and adding Case.of support automatically.
$3
`javascript
Case.of('foo') -> 'lower'
Case.of('foo_bar') -> 'snake'
Case.of('Foo v Bar') -> 'title'
Case.of('foo_ Bar') -> undefinedCase.of('Hello there, Bob!', ['Bob']) -> 'sentence'
Case.flip('FlipMe') -> 'fLIPmE'
Case.flip('TEST THIS!') -> 'test this!'
Case.random('Hello!') -> 'hElLO!'
`
* Case.of(str[, names]): identifies the case of a string, returns undefined if it doesn't match a known type
* Case.flip(str): reverses the case of letters, no other changes
* Case.random(str)`: randomizes the case of letters, no other changes[v1.0.0]: https://github.com/nbubna/store/tree/1.0.0
[v1.0.1]: https://github.com/nbubna/store/tree/1.0.1
[v1.0.3]: https://github.com/nbubna/store/tree/1.0.3
[v1.1.2]: https://github.com/nbubna/store/tree/1.1.2
[v1.2.0]: https://github.com/nbubna/store/tree/1.2.0
[v1.2.1]: https://github.com/nbubna/store/tree/1.2.1
[v1.3.0]: https://github.com/nbubna/store/tree/1.3.0
[v1.3.2]: https://github.com/nbubna/store/tree/1.3.2
[v1.3.3]: https://github.com/nbubna/store/tree/1.3.3
[v1.4.0]: https://github.com/nbubna/store/tree/1.4.0
[v1.4.1]: https://github.com/nbubna/store/tree/1.4.1
[v1.4.2]: https://github.com/nbubna/store/tree/1.4.2
[v1.5.2]: https://github.com/nbubna/store/tree/1.5.2
[v1.5.3]: https://github.com/nbubna/store/tree/1.5.3
[v1.5.4]: https://github.com/nbubna/store/tree/1.5.4
[v1.5.5]: https://github.com/nbubna/store/tree/1.5.5
[v1.6.0]: https://github.com/nbubna/store/tree/1.6.0
[v1.6.1]: https://github.com/nbubna/store/tree/1.6.1
[v1.6.2]: https://github.com/nbubna/store/tree/1.6.2
[v1.6.3]: https://github.com/nbubna/store/tree/1.6.3