STR_LENGTH, STR_LNG

Use either the STR_LENGTH or the STR_LNG script function to obtain the length of a string. These two script functions are functionally identical.

Syntax

STR_LENGTH(String)
STR_LNG(String)

Parameters

  • STR_LENGTH or STR_LNG
    Returns the length of a string

  • String
    Alphanumeric string
    Format: script literal or script variable

Return code: The number of string characters

Examples

The following script returns the length of the string (2):

:SET &LENGTH# = STR_LENGTH("AE")

The following example returns 18 as the number of characters.

:SET &number# = STR_LENGTH(" Automic software ")

The following example checks the value (string) that is assigned to a script variable, and retrieves the length of the string.

:SET &number# = STR_LENGTH(&string)

See also: