Len Function

Official Content
This documentation is valid for:

To return the number of characters in a character expression.

Syntax

Len(Character-Expression)

Type Returned:
Numeric

Where:
Character-Expression
Must be a Character Expression.

Description

The LEN function returns the number of characters in a character expression. Trailing blanks are ignored.

Example

 

We define the following variables:

Variable Type  

&CExp   C(20)
&Length N(1)

Source:

&CExp = 'HELLO'
&Length = Len(&CExp)
&Msg = concat('LEN returns', Str(&Length,1), '')
&CExp = ' HELLO ' //(trailing blanks will be ignored)
&Length = Len(&CExp)
&Msg = Concat('LEN returns', Str(&Length,1), '')

The result is: 'LEN returns 5' and 'LEN returns 6'

Scope

Objects: Procedures, Transactions, Web PanelsWork Panels
Languages: .NET, Ruby (up to GeneXus X Evolution 3), Java, RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol

See Also

Length Method








Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.