STR_LENGTH, STR_LNG

Use either the STR_LENGTH or the STR_LNG script function to obtain the length of a string in characters (not in bytes). 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 in characters

  • String
    Alphanumeric string
    Format: script literal or script variable

Return code: The number of string characters (not bytes).

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)

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

:SET &LENGTH# = STR_LENGTH("Doppelgänger")

See also: