Determines whether or not a string is empty. A string is considered empty if its length is 0 or it is null.

Syntax

JSV_isEmpty(expS)

Prototype

expS.isEmpty()

Returns

The isEmpty function returns true if the expression expS is empty; otherwise, false.

Parameters

The isEmpty function uses the following arguments.

Argument Description
expS The string that is to be evaluated.

Remarks

n/a

Dependencies

A string is considered empty if its length is 0 or it is null.

Example

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