LEN

Use this function to return the length of the specified string. The length includes all characters, including leading and trailing spaces.

Syntax

LEN (String)

Parameter

Description

String

Enter a valid string. The default is the value of the current field.

This function is often confused with the Size function. The LEN function returns the length of the actual data contained in a text string, including leading and trailing spaces. The Size function returns the length of the defined data area for a section field.

Example

Here are some examples:

(Assume the current field contains the text Your Name.)

Function

Result

Explanation

LEN ( )

9

Defaults to the current field.

LEN (" Your Name ")

19

The result includes the leading and trailing spaces of the given field.

LEN ("Street Address")

14

Returns the length of the given string.

LEN (@("ThisField"))

8

Finds the variable field named ThisField on the current section and counts the length of the data. The data in this field is Jane Doe, so the number 8 is returned.

See also