LOTUSSCRIPT LANGUAGE


Len function
Example

Returns the number of characters in a string, or the number of bytes used to hold a numeric value.

Syntax

Len ( { stringExpr | variantExpr | numericExpr | typeName } )

Elements

stringExpr


variantExpr
numericExpr
typeName
Return value

For stringExpr, Len returns the number of characters in the string expression.

For variantExpr, Len returns the number of characters required to hold the value of variantExpr converted to a String.

For numericExpr, Len returns the number of bytes required to hold the contents of numericExpr.

For typeName, Len returns the number of bytes required to hold the contents of all the member variables, unless the user-defined data type includes Variant or variable-length String members. In that case, the length of the variable of the user-defined data type may not be the same as the sum of the lengths of its member variables.

Usage

In LotusScript Release 3 and after, Len(NULL) generates an error. In previous releases of LotusScript, Len(NULL) returned NULL.

Len(v), where v is EMPTY, returns 0.

To determine the length of a string in bytes rather than in characters, use the LenB function. To determine the length of a string in bytes in the platform-native character set, use the LenBP function.

Example
See Also