Len Function

Return the length of a string.

Len (string)

Parameters

String  -  (Input, expression, Required)

Specifies the string whose length is to be returned. If a numeric expression is passed, it is first converted to string form. If anything else other than a string is passed, the result is Error. If Null is passed, the string is assumed to be empty.

Return Value

An integer value containing the length of the passed string.

Examples

Len (“abc”)

Returns 3

Len (12.34)

Returns 5

Len (“”)

Returns 0

Len (Null)

Returns 0

Len (Error)

Returns Error

TIP:

Functions are specifically for use in the Macro Editor. Refer to Microsoft's official VB and JScript documentation for scripting equivalents.

See Also

Functions | Asc function | Chr function | CSet function | Format function | InStr function | LCase function | Left function | Len function | LSet function | LTrim function | Mid function | Replace function | Right function | RSet function | RTrim function | Space function | String function | TCase function | Trim function | UBound function | UCase function


© 2004-2021 looksoftware. All rights reserved.