Determines whether or not a string is empty. A string is considered empty if its length is 0 or it is null.
JSV_isEmpty(expS)
expS.isEmpty()
The isEmpty function returns true if the expression expS is empty; otherwise, false.
The isEmpty function uses the following arguments.
Argument | Description |
expS | The string that is to be evaluated. |
n/a
A string is considered empty if its length is 0 or it is null.
The following lines of code
var string1 = "ABCDEF", string2 = "", string3 = null, string4 = 'A';
document.write( "Is " + string1 +
" empty? " +
JSV_isEmpty(string1) );
document.write( "Is " + string2 +
" empty? " +
JSV_isEmpty(string2) );
document.write( "Is " + string3 +
" empty? " +
JSV_isEmpty(string3) );
document.write( "Is " + string4 +
" empty? " +
JSV_isEmpty(string4) );
produce
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.