Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project









FUNCTION:  String.length

String.length(string)
 
The String.length function returns the integer length of a given string. If the string is an empty string, a zero is returned.
 
Note that you can use the String.isEmpty function to determine if a string is empty (i.e., has zero length).
 
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 LengthExample.wml
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>

<card id="card1">
   <p>
   length example
   </p>
   <do type="accept">
      <go href="LengthExample.wmls#findlength()" />
   </do>
</card>

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

</wml>

 
Code for LengthExample.wmls
extern function findlength()
{
   var str = Dialogs.prompt("Enter a string", "");
   var len = String.length(str);
   WMLBrowser.setVar("strng", str);
   WMLBrowser.setVar("result", len);
   WMLBrowser.go("LengthExample.wml#card2");
};

 


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