jack e1a2621c78 update | il y a 2 ans | |
---|---|---|
.. | ||
LICENSE | il y a 2 ans | |
README.md | il y a 2 ans | |
package.json | il y a 2 ans | |
swap-case.d.ts | il y a 2 ans | |
swap-case.js | il y a 2 ans |
Swap the case of a string.
Supports 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.
npm install swap-case --save
var swapCase = require('swap-case')
swapCase(null) //=> ""
swapCase('string') //=> "STRING"
swapCase('PascalCase') //=> "pASCALcASE"
swapCase('Iñtërnâtiônàlizætiøn') //=> "iÑTËRNÂTIÔNÀLIZÆTIØN"
swapCase('My String', 'tr') //=> "mY sTRİNG"
Includes a TypeScript definition.
MIT