| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Convert a string to dot case.
var dotcase = require( '@stdlib/string/dotcase' );Converts a string to dot case.
var out = dotcase( 'foo bar' );
// returns 'foo.bar'
out = dotcase( 'IS_MOBILE' );
// returns 'is.mobile'
out = dotcase( 'Hello World!' );
// returns 'hello.world'
out = dotcase( '--foo-bar--' );
// returns 'foo.bar'var dotcase = require( '@stdlib/string/dotcase' );
var str = 'Hello World!';
var out = dotcase( str );
// returns 'hello.world'
str = 'HELLO WORLD!';
out = dotcase( str );
// returns 'hello.world'
str = 'To be, or not to be: that is the question.';
out = dotcase( str );
// returns 'to.be.or.not.to.be.that.is.the.question'Usage: dotcase [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 split option is either properly escaped or enclosed in quotes.
# Not escaped...
$ echo -n $'beep\nfoo_bar' | dotcase --split /\r?\n/
# Escaped...
$ echo -n $'beep\nfoo_bar' | dotcase --split /\\r?\\n/The implementation ignores trailing delimiters.
$ dotcase 'hello world!'
hello.worldTo use as a standard stream,
$ echo -n 'beEp booP' | dotcase
beep.boopBy 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\tfoo_bar' | dotcase --split '\t'
beep
foo.bar| Back | FazBrowse Home | New Git URL |