LEN                                                                         Function

LEN(string | variable)

LENB(string | variable)

Description

LEN returns a long value specifying the number of characters in a string, or the number of bytes required to output a variable. The optional parameter, string, is any valid string expression. The optional parameter, variable, is any variable, if variable contains a string the length of the string is returned. One (and only one) of the optional parameters, string and variable, must be supplied.

LENB is a strict bytewise version of LEN. LENB always returns a measurement in bytes. When used on the Unicode strings of Windows CE devices, it will return a number twice the value returned by LEN.

Example

REM LEN Example

'LEN returns string length or variable size

DIM Frog, Survived

Frog = "Staring"

Survived = 2

PRINT "LEN of Frog:", LEN(Frog)

PRINT "LENB of Frog:", LENB(Frog)

PRINT "LEN of Survived:", LEN(Survived)

Output

LEN of Frog:  7

LENB of Frog:14

LEN of Survived:     1

Related Items