@stdlib/string-base-dotcase
v0.2.2
Published
Convert a string to dot case.
Downloads
32
Readme
dotcase
Convert a string to dot case.
Installation
npm install @stdlib/string-base-dotcase
Usage
var dotcase = require( '@stdlib/string-base-dotcase' );
dotcase( str )
Converts a string to dot case.
var str = dotcase( 'foo bar' );
// returns 'foo.bar'
str = dotcase( 'foo bar baz' );
// returns 'foo.bar.baz'
str = dotcase( 'foo_bar' );
// returns 'foo.bar'
Examples
var dotcase = require( '@stdlib/string-base-dotcase' );
var str = 'Hello World!';
var out = dotcase( str );
// returns 'hello.world'
str = 'I am a tiny little teapot';
out = dotcase( str );
// returns 'i.am.a.tiny.little.teapot'
str = 'with big problems';
out = dotcase( str );
// returns 'with.big.problems'
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'
str = 'isMobile';
out = dotcase( str );
// returns 'is.mobile'
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.