invcase

Convert a string to inverse case.

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'
Did you find this page helpful?