Language Reference length Method

                  


Description

Retrieves the length of the string object.

Syntax

intLength = strVariable.length( )
intLength = "String Literal".length( )

Return Value

An integer indicating the length of the string object, including all whitespace.

Remarks

This is the true length of the string. Since the methods that use index values are zero-based, you should subtract one from the value returned from length before using the value in methods such as substring or charAt.