C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...







The JavaScript String object



This article explains about String object into depth.



String Object:


String is nothing but a piece of text. The purpose of string object is to work over text. This is most commonly used object. String object has only one property called length . This returns length of the string.

Syntax:


string.length where string is the variable of type string.

Example



<html>

<head>

<title>JavaScript Tutorials</title>

</head>

<body>

The lengh of the string is :

<script language ="JavaScript">

var v="Dotnet Spider";

document.write(v.length);

</script>

</body>

</html>



output


The above example shows output in browser as The lengh of the string is : 13

var v="Dotnet Spider"; creates a string called V and stores the specified text as Dotnet Spider.
The length of the string is computed using length property .As the string length is 13 it's displayed on browser.



  • Next Chapter: The string Object

  • Previous Chapter: JavaScript Objects

  • Tutorial Index



  • dotNet Slackers

    About Us    Contact Us    Privacy Policy    Terms Of Use