@stdlib/string-base-invcase
v0.2.2
Published
Convert a string to inverse case.
Downloads
9
Readme
invcase
Convert a string to inverse case.
Installation
npm install @stdlib/string-base-invcase
Usage
var invcase = require( '@stdlib/string-base-invcase' );
invcase( str )
Converts a string to inverse case.
var str = invcase( 'foo bar' );
// returns 'FOO BAR'
str = invcase( 'Foo Bar Baz' );
// returns 'fOO bAR bAZ'
str = invcase( 'foo BAR' );
// returns 'FOO bar'
Examples
var invcase = require( '@stdlib/string-base-invcase' );
var str = 'Hello World!';
var out = invcase( str );
// returns 'hELLO wORLD!'
str = 'I am a tiny little teapot';
out = invcase( str );
// returns 'i AM A TINY LITTLE TEAPOT'
str = 'with BIG problems';
out = invcase( str );
// returns 'WITH big PROBLEMS'
str = 'To Be, Or NoT To Be: ThAt Is ThE QuEsTiOn.';
out = invcase( str );
// returns 'tO bE, oR nOt tO bE: tHaT iS tHe qUeStIoN.'
str = 'isMobile';
out = invcase( str );
// returns 'ISmOBILE'
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.