Return to Kroll Design home page

JavaScript Tutorials

 
« Return

length property (strings)

To determine the length of a string, that is, to determine how many characters the string currently contains, look at the "length" property of the string.

Code:

<script type="text/javascript">
//<![CDATA[
my_string = "A Historic Inauguration";
document.write("The length of \"", my_string, "\" is : ", my_string.length);
//]]>
</script>

Output:



 
« Return


©2012 Kroll Design    info@KrollDesign.net    781.910.3694
Last modified: 12/31/1969 7:00 PM