Convert a string to Pascal case.
var pascalcase = require( '@stdlib/string/pascalcase' );Converts a string to Pascal case.
var out = pascalcase( 'foo bar' );
// returns 'FooBar'
out = pascalcase( 'IS_MOBILE' );
// returns 'IsMobile'
out = pascalcase( 'Hello World!' );
// returns 'HelloWorld'
out = pascalcase( '--foo-bar--' );
// returns 'FooBar'
out = pascalcase( 'fooBar' );
// returns 'FooBar'var pascalcase = require( '@stdlib/string/pascalcase' );
var str = 'Hello World!';
var out = pascalcase( str );
// returns 'HelloWorld'
str = 'HELLO WORLD!';
out = pascalcase( str );
// returns 'HelloWorld'
str = 'To be, or not to be: that is the question.';
out = pascalcase( str );
// returns 'ToBeOrNotToBeThatIsTheQuestion'Usage: pascalcase [options] [<string>]
Options:
-h, --help Print this message.
-V, --version Print the package version.
--split sep Delimiter for stdin data. Default: '/\\r?\\n/'.
-
If the split separator is a regular expression, ensure that the
splitoption is either properly escaped or enclosed in quotes.# Not escaped... $ echo -n $'beEp booP\nisMobile' | pascalcase --split /\r?\n/ # Escaped... $ echo -n $'beEp booP\nisMobile' | pascalcase --split /\\r?\\n/
-
The implementation ignores trailing delimiters.
$ pascalcase 'hello world!'
HelloWorldTo use as a standard stream,
$ echo -n 'beEp booP' | pascalcase
BeEpBooPBy default, when used as a standard stream, the implementation assumes newline-delimited data. To specify an alternative delimiter, set the split option.
$ echo -n 'beep_boop\tisMobile' | pascalcase --split '\t'
BeepBoop
IsMobile@stdlib/string/camelcase: convert a string to camel case.@stdlib/string/constantcase: convert a string to constant case.@stdlib/string/kebabcase: convert a string to kebab case.@stdlib/string/snakecase: convert a string to snake case.