@stdlib/assert-is-blank-string
v0.2.2
Published
Test if a value is a blank string.
Downloads
14
Readme
isBlankString
Test if a value is a blank string.
Installation
npm install @stdlib/assert-is-blank-string
Usage
var isBlankString = require( '@stdlib/assert-is-blank-string' );
isBlankString( value )
Tests if a value
is a blank string
(i.e., an empty string or a string consisting only of whitespace characters).
var bool = isBlankString( ' ' );
// returns true
bool = isBlankString( '' );
// returns true
bool = isBlankString( 0 );
// returns false
Examples
var isBlankString = require( '@stdlib/assert-is-blank-string' );
var out = isBlankString( ' ' );
// returns true
out = isBlankString( '\t\t\t' );
// returns true
out = isBlankString( '\r\n' );
// returns true
out = isBlankString( '' );
// returns true
out = isBlankString( 'beep boop' );
// returns false
out = isBlankString( null );
// returns false
See Also
@stdlib/assert-is-blank-string-cli
: CLI package for use as a command-line utility.@stdlib/assert-is-string
: test if a value is a string.@stdlib/assert-is-empty-string
: test if a value is an empty string.
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.