This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Return the length of a string expression in number of bytes.
Syntax
n = LEN(string_expression)
Returns
Number
Parameters
Name |
Type |
Optional |
Meaning |
String_Expression |
String |
No |
Any string expression |
Remarks
LEN will always make a copy of the string expression passed as parameter.
Use LENF to avoid string copy in case of big scalar strings variables
Use StrPtrLEN to avoid string copy in case of big strings like in the following example:
'---Define a 100Mb string
Dim MyString As String = String$(100000000, chr$(0))
MSGBOX 0, "Size: " & StrPtrLEN(STRPTR(MyString))
Use CLen to return the number of characters.
Restrictions
See also
String Handling, LENF, StrPtrLen, CLen
Examples