FUNCTION:  String.isEmpty

The String.isEmpty function tests the length of a given string to determine if it is empty and returns a boolean value. If the string has zero length, true is returned. if the string has a length greater than zero, false is returned.
Note that you can use the String.length function to find the numeric length of a string.
The mandatory string parameter can be any string containing zero or more of any combination of characters (including white spaces). This parameter can also be an empty string.
Code for IsEmptyExample.wml
<?xml version="1.0"?>

<card id="card1">
   isEmpty example
   <do type="accept">
      <go href="IsEmptyExample.wmls#findisempty()" />

<card id="card2">
   string = $(strng)
   <br />
   empty = $(result)


Code for IsEmptyExample.wmls
extern function findisempty()
   var str = Dialogs.prompt("Enter a string", "");
   var res = String.isEmpty(str);
   WMLBrowser.setVar("strng", str);
   WMLBrowser.setVar("result", res);

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information