H I O X INDIA
Javascript Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java-Script Tutorial
Introduction
Variables
Operators
Statements
Loops
Functions
Objects
Arrays
Browser Objects
Form DOM
Ask Your Doubts
Feedback





String Function - length()


Topic

function or method to find the length or size of the string in javascript?



Explanation

Object: String

Method or Function: length

Description: This will count the total number of characters (length or size) present in the string and returns the value.


Example Code:
<script language=javascript>
var ss = "a character count - size test ";
var result = ss.length;
document.write(result);
</script>

Result:

Explanation:
In the above example,
  • the string is stored in a variable ss.
  • then the function is called as "ss.length".
  • the method counts the total characters in the string and returns it.
  • the result is of variable type, integer.



  •         Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

    others

    privacy policy     license     sitemap
    © 2004-2005 HIOX INDIA - hioxindia.com

    Other Links