This property returns the number of characters in the string.
Grammar
string.length
Here are the details of the parameters:
Return value:
Returns the number of characters in the string.
Example:
<html> <head> <title>JavaScript String length Property</title> </head> <body> <script type="text/javascript"> var str = new String( "This is string" ); document.write("str.length is:" + str.length); </script> </body> </html>
This will produce the following results:
str.length is:14